From 1a2e64daeda1af9de43be75ea3d61e4343bf99fd Mon Sep 17 00:00:00 2001 From: trotFunky Date: Fri, 2 Mar 2018 18:03:40 +0100 Subject: [PATCH] =?UTF-8?q?Modifi=C3=A9=20pour=20avoir=20un=20son=20al?= =?UTF-8?q?=C3=A9atoire.=20Et=20oui,=20c'est=20d=C3=A9bile!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Perso/bootSound.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/Perso/bootSound.sh b/Perso/bootSound.sh index cb0cf89..9c14a2d 100755 --- a/Perso/bootSound.sh +++ b/Perso/bootSound.sh @@ -1,5 +1,16 @@ #! /bin/sh +cd /home/trotfunky/Documents/Sounds/Startup/ +qty=$(ls | grep -c "" ) -mplayer -nogui -softvol -ao alsa,pulse /home/trotfunky/Documents/Sounds/winxp.mp3 & +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 - exit 0 \ No newline at end of file