dotfiles/.config/eww/scripts/set-volume.sh

14 lines
292 B
Bash
Raw Normal View History

2024-11-05 14:09:13 +01:00
#!/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)"