Clean up sway keybindings

This commit is contained in:
Fabian Hauser 2022-01-03 11:36:48 +01:00
parent 624b1c0ac2
commit 25563873ad
2 changed files with 15 additions and 16 deletions

View file

@ -3,8 +3,6 @@
environment.systemPackages = with pkgs;
[ # Utilities
freetype
light
xorg.xbacklight
feh
redshift
numlockx # TODO: Does this work?

View file

@ -79,7 +79,11 @@
"13" = [{ class = "^Spotify$"; }];
};
keybindings = let mod = wayland.windowManager.sway.config.modifier;
keybindings = let
mod = wayland.windowManager.sway.config.modifier;
playerctl = "${pkgs.playerctl}/bin/playerctl";
pamixer = "${pkgs.pamixer}/bin/pamixer";
light = "${pkgs.light}/bin/light";
in lib.mkOptionDefault {
"${mod}+p" = "exec passbemenu";
"${mod}+x" = "move workspace to output right";
@ -103,23 +107,20 @@
"Ctrl+mod1+Shift+L" = "exec ${pkgs.systemd}/bin/systemctl suspend";
# pulse audio volume control
XF86AudioLowerVolume =
"exec pactl set-sink-volume '@DEFAULT_SINK@' '-3%'";
XF86AudioRaiseVolume =
"exec pactl set-sink-volume '@DEFAULT_SINK@' '+3%'";
XF86AudioMute = "exec pactl set-sink-mute '@DEFAULT_SINK@' 'toggle'";
XF86AudioMicMute =
"exec pactl set-source-mute '@DEFAULT_SOURCE@' 'toggle'";
XF86AudioLowerVolume = "exec ${pamixer} --decrease 3";
XF86AudioRaiseVolume = "exec ${pamixer} --increase 3";
XF86AudioMute = "exec ${pamixer} --toggle-mute";
XF86AudioMicMute = "exec ${pamixer} --default-source --toggle-mute";
# Spotify control
XF86AudioPause = "exec playerctl play-pause";
XF86AudioPlay = "exec playerctl play-pause";
XF86AudioNext = "exec playerctl next";
XF86AudioPrev = "exec playerctl previous";
XF86AudioPause = "exec ${playerctl} play-pause";
XF86AudioPlay = "exec ${playerctl} play-pause";
XF86AudioNext = "exec ${playerctl} next";
XF86AudioPrev = "exec ${playerctl} previous";
# screen brightness
XF86MonBrightnessUp = "exec light -A 10";
XF86MonBrightnessDown = "exec light -U 5";
XF86MonBrightnessUp = "exec ${light} -A 10";
XF86MonBrightnessDown = "exec ${light} -U 5";
# screenshot
Print = "exec ${pkgs.sway-contrib.grimshot}/bin/grimshot copy area";