{ config, lib, ... }: let inherit (config.wayland.windowManager.sway.config) menu; mod = config.wayland.windowManager.sway.config.modifier; term = config.wayland.windowManager.sway.config.terminal; grim = "grim -g"; slurp-screen = "\"$(slurp -c -b '#1e1e2e80' -o -r)\" -"; slurp-box = "\"$(slurp -c '#f38ba8ff' -b '#1e1e2e80' -w 1 -d -F 'IBM Plex Mono')\" -"; satty = "satty -f -"; cfg = config.py.gui; in { config.wayland.windowManager.sway.config.keybindings = lib.mkIf cfg.enable ( lib.mkOptionDefault { "${mod}+d" = "${menu}"; "${mod}+Shift+F" = "exec MOZ_DISABLE_RDD_SANDBOX=1 firefox"; "${mod}+Return" = "exec ${term}"; "${mod}+x" = "exec wlogout"; "${mod}+s" = null; "${mod}+w" = null; "XF86MonBrightnessDown" = "exec brightnessctl set 5%-"; "XF86MonBrightnessUp" = "exec brightnessctl set +5%"; "XF86AudioRaiseVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%+"; "XF86AudioLowerVolume" = "exec wpctl set-volume @DEFAULT_AUDIO_SINK@ 5%-"; "XF86AudioMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle"; "XF86AudioMicMute" = "exec wpctl set-mute @DEFAULT_AUDIO_SOURCE@ toggle"; "XF86AudioPlay" = "exec playerctl play-pause"; "XF86AudioNext" = "exec playerctl next"; "XF86AudioPrev" = "exec playerctl previous"; "Shift+F3" = "exec ${grim} ${slurp-screen} | ${satty}"; "Shift+F4" = "exec ${grim} ${slurp-box} | ${satty}"; "${mod}+Shift+1" = "move container to workspace number 1"; "${mod}+Shift+2" = "move container to workspace number 2"; "${mod}+Shift+3" = "move container to workspace number 3"; "${mod}+Shift+4" = "move container to workspace number 4"; "${mod}+Shift+5" = "move container to workspace number 5"; "${mod}+Shift+6" = "move container to workspace number 6"; "${mod}+Shift+7" = "move container to workspace number 7"; "${mod}+Shift+8" = "move container to workspace number 8"; "${mod}+Shift+9" = "move container to workspace number 9"; "${mod}+Shift+0" = "move container to workspace number 10"; "${mod}+0" = "workspace number 10"; } ); }