From 19473edd6cb0a65bada8c5ad85b4ae31d7bb162b Mon Sep 17 00:00:00 2001 From: traxys Date: Sun, 25 Jun 2023 10:30:40 +0200 Subject: [PATCH] personal-gui: Manage layout of all keyboards --- extra_info.nix | 5 --- hostconfig/ZeNixComputa/extra_info.nix | 4 --- hostconfig/thinkpad-nixos/extra_info.nix | 2 -- personal-gui/wm/default.nix | 12 +++++--- personal-gui/wm/sway.nix | 39 +++++++++++------------- 5 files changed, 25 insertions(+), 37 deletions(-) diff --git a/extra_info.nix b/extra_info.nix index e0d1188..0bf1984 100644 --- a/extra_info.nix +++ b/extra_info.nix @@ -13,11 +13,6 @@ with builtins; { }; extraInfo.inputs = { - keyboard = mkOption { - type = types.listOf types.str; - description = "Sway keyboard identifier"; - default = []; - }; touchpad = mkOption { type = types.nullOr types.str; description = "Sway touchpad identifier"; diff --git a/hostconfig/ZeNixComputa/extra_info.nix b/hostconfig/ZeNixComputa/extra_info.nix index 12ae76b..417aab5 100644 --- a/hostconfig/ZeNixComputa/extra_info.nix +++ b/hostconfig/ZeNixComputa/extra_info.nix @@ -4,10 +4,6 @@ extraInfo.email = "quentin+dev@familleboyer.net"; extraInfo.inputs = { - keyboard = [ - "12815:20548:Glorious_GMMK_Pro" - "12815:20548:Glorious_GMMK_Pro_Consumer_Control" - ]; #touchpad = "2:7:SynPS/2_Synaptics_TouchPad"; }; } diff --git a/hostconfig/thinkpad-nixos/extra_info.nix b/hostconfig/thinkpad-nixos/extra_info.nix index 7debc31..693329c 100644 --- a/hostconfig/thinkpad-nixos/extra_info.nix +++ b/hostconfig/thinkpad-nixos/extra_info.nix @@ -1,8 +1,6 @@ { extraInfo.email = "quentin.boyer@***REMOVED***"; - extraInfo.inputs.keyboard = ["1:1:AT_Translated_Set_2_keyboard"]; - extraInfo.username = "traxys"; extraInfo.inputs.touchpad = "2:7:SynPS/2_Synaptics_TouchPad"; diff --git a/personal-gui/wm/default.nix b/personal-gui/wm/default.nix index 29e8615..872b08e 100644 --- a/personal-gui/wm/default.nix +++ b/personal-gui/wm/default.nix @@ -150,10 +150,14 @@ "XF86AudioNext" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify next"; "XF86AudioPrev" = "exec ${pkgs.playerctl}/bin/playerctl -p spotify previous"; - # Gromit - "Ctrl+Shift+I" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -a"; - "Ctrl+Shift+D" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -q"; - "Ctrl+Shift+H" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -c"; + # Gromit + "Ctrl+Shift+I" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -a"; + "Ctrl+Shift+D" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -q"; + "Ctrl+Shift+H" = "exec ${pkgs.gromit-mpx}/bin/gromit-mpx -c"; + + # Change keyboard layout + "${mod}+dollar" = "input type:keyboard xkb_switch_layout next"; # Dvorak + "${mod}+grave" = "input type:keyboard xkb_switch_layout next"; # Qwerty # Focus "${mod}+Left" = "focus left"; diff --git a/personal-gui/wm/sway.nix b/personal-gui/wm/sway.nix index 11df013..dbf8a99 100644 --- a/personal-gui/wm/sway.nix +++ b/personal-gui/wm/sway.nix @@ -139,28 +139,23 @@ in { ]; input = let inputs = config.extraInfo.inputs; - inputsCfg = - [ - ( - if inputs.touchpad != null - then { - name = inputs.touchpad; - value = {dwt = "disable";}; - } - else null - ) - ] - ++ ( - builtins.map (k: { - name = k; - value = { - xkb_layout = "us"; - xkb_variant = "dvp"; - xkb_options = "compose:102"; - }; - }) - inputs.keyboard - ); + inputsCfg = [ + ( + if inputs.touchpad != null + then { + name = inputs.touchpad; + value = {dwt = "disable";}; + } + else null + ) + { + name = "type:keyboard"; + value = { + xkb_layout = "us(dvp),us"; + xkb_options = "compose:102"; + }; + } + ]; in builtins.listToAttrs (builtins.filter (s: s != null) inputsCfg); output = config.extraInfo.outputs;