Created
December 4, 2017 22:11
-
-
Save yolabingo/3c0b286ba7f6b85b518d4d052e91c9fb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
scriptname=$(basename "$0") | |
for index in $(pacmd list-sink-inputs | egrep -i -B 25 "seamonkey|chrome|firefox" | grep index: | awk '{print $2}') | |
do | |
volume=$(pacmd list-sink-inputs | grep -A 8 "index: ${index}" | grep volume: | awk '{print $3}') | |
if [ $scriptname == "volume-up" ] | |
then | |
echo "volume up" | |
(( volume=volume+5000 )) | |
fi | |
if [ $scriptname == "volume-down" ] | |
then | |
echo "volume down" | |
(( volume=volume-5000 )) | |
fi | |
pacmd set-sink-input-volume $index $volume | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment