add files

This commit is contained in:
2026-06-06 12:24:00 +02:00
commit 22296aa139
22 changed files with 3425 additions and 0 deletions
+74
View File
@@ -0,0 +1,74 @@
#!/bin/bash
# check command line arguments first
if [ $# != 1 ]; then
echo "Usage ${0} up|down|mute"
exit 1
fi
if [ $1 != "up" -a $1 != "down" -a $1 != "mute" ]; then
echo "Usage ${0} up|down|mute"
exit 1
fi
# go through each line of the sink-inputs output
pactl list sink-inputs | while read line; do
# Update current sink input id
[[ $line =~ ^Sink\ Input\ \#([[:digit:]]+) ]] && this_input=${BASH_REMATCH[1]}
# check if it is spotify
if [[ $line =~ "application.name = \"spotify\"" ]]; then
echo "Spotify is sink-input ${this_input}"
case $1 in
up)
pactl set-sink-input-volume ${this_input} +5%
;;
down)
pactl set-sink-input-volume ${this_input} -5%
;;
mute)
pactl set-sink-input-mute ${this_input} toggle
;;
*)
echo "Error"
;;
esac
fi
done