diff --git a/lyrathorpe/home/sway.nix b/lyrathorpe/home/sway.nix index 7add6c9..fa7e9bb 100644 --- a/lyrathorpe/home/sway.nix +++ b/lyrathorpe/home/sway.nix @@ -55,20 +55,27 @@ } ]; - keybindings = lib.mkOptionDefault ( - { - "${modifier}+l" = "exec ${pkgs.swaylock}/bin/swaylock -f"; - "Print" = "exec ${pkgs.grim}/bin/grim ~/screenshot-$(date +%F-%H%M%S).png"; - "XF86AudioRaiseVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; - "XF86AudioLowerVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; - "XF86AudioMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; - } - # Screen backlight: laptops only (no internal backlight on a desktop). - // lib.optionalAttrs portable { - "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%+"; - "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-"; - } - ); + keybindings = lib.mkMerge [ + # Bind the launcher to Mod+Space. This deliberately replaces the default + # Mod+Space (focus mode_toggle); a bare attrset (normal priority) wins + # over the module default, whereas the mkOptionDefault block below would + # only tie with it. Mod+d still runs the launcher too (module default). + { "${modifier}+space" = "exec ${menu}"; } + (lib.mkOptionDefault ( + { + "${modifier}+l" = "exec ${pkgs.swaylock}/bin/swaylock -f"; + "Print" = "exec ${pkgs.grim}/bin/grim ~/screenshot-$(date +%F-%H%M%S).png"; + "XF86AudioRaiseVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; + "XF86AudioLowerVolume" = "exec ${pkgs.wireplumber}/bin/wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; + "XF86AudioMute" = "exec ${pkgs.wireplumber}/bin/wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; + } + # Screen backlight: laptops only (no internal backlight on a desktop). + // lib.optionalAttrs portable { + "XF86MonBrightnessUp" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%+"; + "XF86MonBrightnessDown" = "exec ${pkgs.brightnessctl}/bin/brightnessctl set 5%-"; + } + )) + ]; }; };