1
0
Fork 0
Scripts/Perso/bootSound.sh

16 lines
342 B
Bash
Raw Normal View History

2017-12-27 18:07:32 +01:00
#! /bin/sh
cd /home/trotfunky/Documents/Sounds/Startup/
qty=$(ls | grep -c "" )
2017-12-27 18:07:32 +01:00
if [ $qty -lt 10 ]; then
maxBit=1
diGrep=[[:digit:]]
elif [ $qty -lt 100]; then
maxBit=2
diGrep=[[:digit:]][[:digit:]]
fi
mplayer -nogui -softvol -ao alsa,pulse $(expr $(strings /dev/urandom | cut -b 1-$maxBit | grep $diGrep -m 1 ) % $qty )* &
cd -
2017-12-27 18:07:32 +01:00
exit 0