From cf384c60509eeff22375b7c54a747ec58402dd63 Mon Sep 17 00:00:00 2001 From: Emma Thorpe Date: Tue, 9 Jun 2026 18:43:07 +0100 Subject: [PATCH] fix(sway): bind the launcher to Mod+Space Only `menu` was set, which the module's default keybindings run on Mod+d; Mod+Space defaulted to `focus mode_toggle`, so sway-launcher-desktop was never reachable from Mod+Space. Add an explicit Mod+Space -> exec ${menu} binding at normal priority (via mkMerge) so it overrides the default. Mod+d still launches it as well. Co-Authored-By: Claude Opus 4.8 (1M context) --- lyrathorpe/home/sway.nix | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) 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%-"; + } + )) + ]; }; };