dotfiles/.config/eww/scripts/set-volume.sh
2024-11-05 14:09:13 +01:00

13 lines
292 B
Bash
Executable file

#!/bin/bash
if [[ "$2" =~ ^[0-9]+$ ]]; then
if [[ "$1" == "input" ]]; then
wpctl set-volume @DEFAULT_AUDIO_SOURCE@ "$2%"
else
wpctl set-volume @DEFAULT_AUDIO_SINK@ "$2%"
fi
else
swayosd-client "--$1-volume" "$2"
fi
eww update volume="$(~/.config/eww/scripts/get-volume.sh)"