Skip to content

Commit

Permalink
Merge pull request #316275 from OPNA2608/fix/lomiri-xkb-layout
Browse files Browse the repository at this point in the history
lomiri.lomiri: Try to consider services.xserver.xkb.layout
  • Loading branch information
OPNA2608 authored Jun 7, 2024
2 parents 443f72c + 2735184 commit 5b3b5d7
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 @@ -37,6 +37,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 5b3b5d7

Please sign in to comment.