Skip to content

Commit

Permalink
lomiri.lomiri: Try to consider services.xserver.xkb.layout
Browse files Browse the repository at this point in the history
Propagate the configuration setting through an envvar, check the envvar in the compositor.
Needed because querying AccountsSettings for this information fails, due to Ubuntu-only
"InputSources" interface. So you're stuck on US layout without this hack.
  • Loading branch information
OPNA2608 committed May 31, 2024
1 parent 661b809 commit 2735184
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nixos/modules/services/desktop-managers/lomiri.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ in {
suru-icon-theme
# telephony-service # currently broken: https://github.com/NixOS/nixpkgs/pull/314043
]);
variables = {
# To override the keyboard layouts in Lomiri
NIXOS_XKB_LAYOUTS = config.services.xserver.xkb.layout;
};
};

hardware.pulseaudio.enable = lib.mkDefault true;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From 640cab41986fac83742af39dd19877041a2ab8dc Mon Sep 17 00:00:00 2001
From: OPNA2608 <[email protected]>
Date: Sat, 1 Jun 2024 00:22:27 +0200
Subject: [PATCH] Check NIXOS_XKB_LAYOUTS for layouts before falling back to
"us"

---
plugins/AccountsService/AccountsService.cpp | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/plugins/AccountsService/AccountsService.cpp b/plugins/AccountsService/AccountsService.cpp
index bcf18246c..f4a7dfaa1 100644
--- a/plugins/AccountsService/AccountsService.cpp
+++ b/plugins/AccountsService/AccountsService.cpp
@@ -295,6 +295,11 @@ QStringList AccountsService::keymaps() const
return simplifiedMaps;
}

+ char* fallbackNixosLayouts = getenv("NIXOS_XKB_LAYOUTS");
+ if (fallbackNixosLayouts != NULL && fallbackNixosLayouts[0] != '\0') {
+ return QString(fallbackNixosLayouts).split(QLatin1Char(','), Qt::SkipEmptyParts);
+ }
+
return {QStringLiteral("us")};
}

--
2.42.0

1 change: 1 addition & 0 deletions pkgs/desktops/lomiri/applications/lomiri/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ stdenv.mkDerivation (finalAttrs: {
})

./9901-lomiri-Disable-Wizard.patch
./9902-lomiri-Check-NIXOS_XKB_LAYOUTS.patch
];

postPatch = ''
Expand Down

0 comments on commit 2735184

Please sign in to comment.