2020-03-08 21:43:12 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2020-03-12 16:27:53 +00:00
|
|
|
# This is a very hacky way of doing this. Default sink for desktop is 0 and for laptop is 3. Kies de eerste de beste die werkt
|
|
|
|
if pamixer --list-sinks | grep -q "^0"; then
|
|
|
|
sink=0
|
|
|
|
elif pamixer --list-sinks | grep -q "^3"; then
|
|
|
|
sink=3
|
|
|
|
fi
|
|
|
|
|
2020-03-08 21:43:12 +00:00
|
|
|
if [ "$1" == "inc" ]; then
|
2020-03-12 16:27:53 +00:00
|
|
|
pactl -- set-sink-volume "$sink" +5%
|
2020-03-08 21:43:12 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" == "dec" ]; then
|
2020-03-12 16:27:53 +00:00
|
|
|
pactl -- set-sink-volume "$sink" -5%
|
2020-03-08 21:43:12 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$1" == "mute" ]; then
|
2020-03-12 16:27:53 +00:00
|
|
|
pactl -- set-sink-mute "$sink" toggle
|
2020-03-08 21:43:12 +00:00
|
|
|
fi
|
|
|
|
|
2020-03-12 16:27:53 +00:00
|
|
|
VOLUME=$(pamixer --sink "$sink" --get-volume)
|
|
|
|
if [ "$(pamixer --sink "$sink" --get-mute)" == "true" ]; then
|
|
|
|
ICON=audio-volume-muted
|
2020-03-08 21:43:12 +00:00
|
|
|
elif [ "$VOLUME" -le 20 ]; then
|
2020-03-12 16:27:53 +00:00
|
|
|
ICON=audio-volume-low
|
2020-03-08 21:43:12 +00:00
|
|
|
elif [ "$VOLUME" -le 60 ]; then
|
2020-03-12 16:27:53 +00:00
|
|
|
ICON=audio-volume-medium
|
|
|
|
else
|
|
|
|
ICON=audio-volume-high
|
|
|
|
fi
|
2020-03-08 21:43:12 +00:00
|
|
|
|
|
|
|
notify-send.py "Volume" "$VOLUME/100" \
|
2020-03-12 16:27:53 +00:00
|
|
|
--hint string:image-path:$ICON boolean:transient:true \
|
|
|
|
--replaces-process "volume-popup" &
|