spotify-connect-web
spotify-connect-web copied to clipboard
Volume control from bash?
Hello,
is there a way to volume control from a bash script like curl with port 4000? Maybe you have a snippet for me to increase or decrease volume!?
Thx
#!/bin/bash VOL=3 if [ $1 = '+' ] then amixer set PCM -- $[$(amixer get PCM|grep -o [0-9]*%|sed 's/%//')+${VOL}]%
elif [ $1 = '-' ] then amixer set PCM -- $[$(amixer get PCM|grep -o [0-9]%|sed 's/%//')-${VOL}]% elif [[ $1 =~ [gG][eE][tT] ]] then VOLLVL=$(amixer get PCM | grep -E '%' | awk '{print $4, $5}') echo "Volume level = ${VOLLVL}" else echo "Bad input parameter (+/-/GET)" fi
This could be solution, when you want to controll volume from bash. I'm using Raspberry SSH android app and I'm using this script for it.