Last active
January 18, 2017 16:41
-
-
Save ivanhuay/6e7023311aa88b63ff2a09d5b71ac6fc to your computer and use it in GitHub Desktop.
Bash script to change volumen random
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 | |
COUNTER=0 | |
STARTWAIT=20 | |
echo "waiting $STARTWAIT seconds!" | |
sleep $STARTWAIT | |
echo "Random volumen >:D" | |
while true; do | |
echo "number: $COUNTER" | |
if [ $(( COUNTER % 2 )) -eq 0 ]; then | |
RANDOMPERCENT=$( node -e "console.log(Math.round(Math.random()*50)+10)" ) | |
else | |
RANDOMPERCENT=$(( ( RANDOM % 55 ) + 10 )) | |
fi | |
echo "volume: $RANDOMPERCENT %" | |
echo "------------------------" | |
amixer set Master $RANDOMPERCENT% | |
let COUNTER+=1 | |
sleep 10 | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment