diff --git a/bin/volume b/bin/volume new file mode 100755 index 0000000..c9af288 --- /dev/null +++ b/bin/volume @@ -0,0 +1,23 @@ +#!/bin/bash +sink=$(pactl list sinks | grep -B 1 "State: RUNNING" | grep -oE '[0-9]*') +cmd="" + +if [ -z "$sink" ]; then + echo "ERROR: invalid sink: \"$sink\"" + exit 1 +fi + +case $1 in + d*) + pactl set-sink-volume $sink -5% + ;; + i*) + pactl set-sink-volume $sink +5% + ;; + m*) + pactl set-sink-mute $sink toggle + ;; + *) + echo "ERROR: invalid command: \"$1\"" + ;; +esac diff --git a/config b/config index e9dbab7..a10c90f 100644 --- a/config +++ b/config @@ -17,6 +17,7 @@ set $right l set $term termite set $background $HOME/Cloud/xkonni/Pictures/wallpaper/5k_bavarian_forest_bw.jpg set $lock_cmd $HOME/.config/sway/bin/lock +set $volume_cmd "$HOME/.config/sway/bin/volume set $font "Cascadia Code PL Regular 10" # Your preferred application launcher @@ -150,9 +151,10 @@ bindsym $mod+a focus parent # ## Volume # -bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% -bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% -bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle + +bindsym XF86AudioRaiseVolume exec $volume_cmd increase +bindsym XF86AudioLowerVolume exec $volume_cmd decrease +bindsym XF86AudioMute exec $volume_cmd mute # ## Screenshot #