From e7b0476c368031117a4978929d7e106654039724 Mon Sep 17 00:00:00 2001 From: finga Date: Sat, 27 Apr 2024 14:52:00 +0200 Subject: [PATCH] media: Extract media key bindings Extract media key bindings into own file. --- .config/sway/config | 13 ------------- .config/sway/config.d/media | 12 ++++++++++++ .gitignore.d/sway | 1 + 3 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 .config/sway/config.d/media diff --git a/.config/sway/config b/.config/sway/config index 619abae..628288a 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -59,19 +59,6 @@ bindsym $mod+a focus parent # focus the child container bindsym $mod+q focus child -# media keys -set $refresh_i3status killall -SIGUSR1 i3status-rs -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3status -bindsym $mod+XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1% && $refresh_i3status -bindsym $mod+XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1% && $refresh_i3status -bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status -bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status -bindsym XF86AudioNext exec --no-startup-id mpc next -bindsym XF86AudioPlay exec --no-startup-id mpc toggle -bindsym XF86AudioPrev exec --no-startup-id mpc prev -bindsym XF86AudioStop exec --no-startup-id mpc stop - # exit sway bindsym $mod+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' diff --git a/.config/sway/config.d/media b/.config/sway/config.d/media new file mode 100644 index 0000000..02cd8f0 --- /dev/null +++ b/.config/sway/config.d/media @@ -0,0 +1,12 @@ +# media keys +set $refresh_i3status killall -SIGUSR1 i3status-rs +bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -5% && $refresh_i3status +bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +5% && $refresh_i3status +bindsym $mod+XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -1% && $refresh_i3status +bindsym $mod+XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +1% && $refresh_i3status +bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status +bindsym XF86AudioMicMute exec --no-startup-id pactl set-source-mute @DEFAULT_SOURCE@ toggle && $refresh_i3status +bindsym XF86AudioNext exec --no-startup-id mpc next +bindsym XF86AudioPlay exec --no-startup-id mpc toggle +bindsym XF86AudioPrev exec --no-startup-id mpc prev +bindsym XF86AudioStop exec --no-startup-id mpc stop diff --git a/.gitignore.d/sway b/.gitignore.d/sway index 4ad37a5..b0ec692 100644 --- a/.gitignore.d/sway +++ b/.gitignore.d/sway @@ -4,6 +4,7 @@ !/.config/i3status-rust/secondary.toml !/.config/sway/config !/.config/sway/config.d/dunst +!/.config/sway/config.d/media !/.gitignore.d/sway !/.local/bin/fuzzy-i3lock !/.local/bin/i3-run