From 25563873ad0a43af48a324782285310f4ea0bb81 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Mon, 3 Jan 2022 11:36:48 +0100 Subject: [PATCH] Clean up sway keybindings --- defaults/desktop/desktop-environment.nix | 2 -- defaults/user-configuration/fhauser/sway.nix | 29 ++++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/defaults/desktop/desktop-environment.nix b/defaults/desktop/desktop-environment.nix index 001f2be..8bf8d7f 100644 --- a/defaults/desktop/desktop-environment.nix +++ b/defaults/desktop/desktop-environment.nix @@ -3,8 +3,6 @@ environment.systemPackages = with pkgs; [ # Utilities freetype - light - xorg.xbacklight feh redshift numlockx # TODO: Does this work? diff --git a/defaults/user-configuration/fhauser/sway.nix b/defaults/user-configuration/fhauser/sway.nix index e802a42..3f91bae 100644 --- a/defaults/user-configuration/fhauser/sway.nix +++ b/defaults/user-configuration/fhauser/sway.nix @@ -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";