fix(gs/system): Explicitly add all default i3 keybindings

Something I changed - perhaps removing lib.mkOptionDefault - caused
the *default* i3 keybindings (things like switching workspaces and
toggling the split layout which I had not added myself) not to get
added. This adds them back.

Change-Id: I301a346eabb4f7fc4499b60a4c26956fb1e08b0d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2218
Reviewed-by: glittershark <grfn@gws.fyi>
Tested-by: BuildkiteCI
This commit is contained in:
Griffin Smith 2020-12-01 11:58:19 -05:00 committed by glittershark
parent 902bf5bdd9
commit 8ae4854de8
2 changed files with 72 additions and 46 deletions

View file

@ -59,4 +59,6 @@ in {
ssh mugwump sudo $system/bin/switch-to-configuration switch
'')
];
xsession.windowManager.i3.config.keybindings.F7 = "exec lock";
}

View file

@ -17,6 +17,9 @@ let
--output DP-4 --off
'';
};
inherit (builtins) map;
inherit (lib) mkMerge range;
in {
options = with lib; {
system.machine.wirelessInterface = mkOption {
@ -51,6 +54,11 @@ in {
# GIFs
picom
peek
(pkgs.writeShellScriptBin "lock" ''
playerctl pause
${pkgs.i3lock}/bin/i3lock -c 222222
'')
];
xsession.scriptPath = ".xsession";
@ -59,7 +67,17 @@ in {
enable = true;
config = {
modifier = mod;
keybindings = lib.mkOptionDefault rec {
keybindings =
mkMerge (
(map
(n: {
"${mod}+${toString n}" =
"workspace ${toString n}";
"${mod}+Shift+${toString n}" =
"move container to workspace ${toString n}";
})
(range 0 9))
++ [(rec {
"${mod}+h" = "focus left";
"${mod}+j" = "focus down";
"${mod}+k" = "focus up";
@ -77,6 +95,9 @@ in {
"${mod}+Shift+s" = "split h";
"${mod}+Shift+v" = "split v";
"${mod}+e" = "layout toggle split";
"${mod}+w" = "layout tabbed";
"${mod}+s" = "layout stacking";
"${mod}+f" = "fullscreen";
@ -119,8 +140,11 @@ in {
"XF86AudioMute" = "exec pulseaudio-ctl mute";
# Lock
Pause = "exec \"sh -c 'playerctl pause; ${pkgs.i3lock}/bin/i3lock -c 222222'\"";
F7 = Pause;
Pause = "exec lock";
# Sleep/hibernate
"${mod}+Escape" = "exec systemctl suspend";
"${mod}+Shift+Escape" = "exec systemctl hibernate";
# Screen Layout
"${mod}+Shift+t" = "exec xrandr --auto";
@ -132,7 +156,7 @@ in {
# Notifications
"${mod}+Shift+n" = "exec killall -SIGUSR1 .dunst-wrapped";
"${mod}+n" = "exec killall -SIGUSR2 .dunst-wrapped";
};
})]);
fonts = [ decorationFont ];