nixos: sway: add keybindings

This commit is contained in:
Guanran Wang 2024-01-28 06:31:43 +08:00
parent 2e30b2cd12
commit 62838f6f4a
Signed by: nyancat
SSH key fingerprint: SHA256:8oWGKciPALWut/6WA27oFKofX+6Wtc0gQnsefXLQx/8

View file

@ -65,7 +65,6 @@
### Keybinds ### Keybinds
modifier = "Mod4"; modifier = "Mod4";
modes = {};
keybindings = let keybindings = let
inherit (config.wayland.windowManager.sway.config) modifier; inherit (config.wayland.windowManager.sway.config) modifier;
setBrightness = "/home/guanranwang/.local/bin/wrapped-brightnessctl"; setBrightness = "/home/guanranwang/.local/bin/wrapped-brightnessctl";
@ -78,6 +77,7 @@
"${modifier}+s" = "split toggle"; "${modifier}+s" = "split toggle";
"${modifier}+v" = "floating toggle"; "${modifier}+v" = "floating toggle";
"${modifier}+f" = "fullscreen toggle"; "${modifier}+f" = "fullscreen toggle";
"${modifier}+r" = "mode resize";
"${modifier}+q" = "kill"; "${modifier}+q" = "kill";
"${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'"; "${modifier}+Shift+e" = "exec swaynag -t warning -m 'You pressed the exit shortcut. Do you really want to exit sway? This will end your Wayland session.' -b 'Yes, exit sway' 'swaymsg exit'";
@ -86,6 +86,10 @@
"${modifier}+j" = "focus down"; "${modifier}+j" = "focus down";
"${modifier}+k" = "focus up"; "${modifier}+k" = "focus up";
"${modifier}+l" = "focus right"; "${modifier}+l" = "focus right";
"${modifier}+Shift+h" = "move left";
"${modifier}+Shift+j" = "move down";
"${modifier}+Shift+k" = "move up";
"${modifier}+Shift+l" = "move right";
### Execute other stuff ### Execute other stuff
# Launch applications # Launch applications
@ -96,7 +100,7 @@
# Rofi # Rofi
"${modifier}+d" = "exec rofi -show drun -show-icons -icon-theme ${config.gtk.iconTheme.name}"; "${modifier}+d" = "exec rofi -show drun -show-icons -icon-theme ${config.gtk.iconTheme.name}";
"${modifier}+Shift+d" = "exec ${lib.getExe pkgs.cliphist} list | rofi -dmenu | ${lib.getExe pkgs.cliphist} decode | ${pkgs.wl-clipboard}/bin/wl-copy"; "${modifier}+Shift+d" = "exec ${lib.getExe pkgs.cliphist} list | rofi -dmenu | ${lib.getExe pkgs.cliphist} decode | ${pkgs.wl-clipboard}/bin/wl-copy";
"${modifier}+Shift+l" = ''exec rofi -modi "power-menu:rofi-power-menu --confirm=reboot/shutdown" -show power-menu''; "${modifier}+Shift+Semicolon" = ''exec rofi -modi "power-menu:rofi-power-menu --confirm=reboot/shutdown" -show power-menu'';
# Screenshot # Screenshot
"${modifier}+Shift+s" = "exec ${screenshot} region"; "${modifier}+Shift+s" = "exec ${screenshot} region";