personal-gui: Manage layout of all keyboards

This commit is contained in:
traxys 2023-06-25 10:30:40 +02:00
parent c794ff5310
commit 19473edd6c
5 changed files with 25 additions and 37 deletions

View file

@ -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";

View file

@ -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";
};
}

View file

@ -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";

View file

@ -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";

View file

@ -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;