2015-11-06 17:40:33 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
#set -x
|
|
|
|
|
2017-01-24 04:32:20 +01:00
|
|
|
source ./config.sh
|
2015-11-06 17:40:33 +01:00
|
|
|
|
|
|
|
killed(){
|
|
|
|
echo 'Music stopped.'
|
|
|
|
}
|
|
|
|
|
|
|
|
trap killed EXIT TERM INT
|
|
|
|
|
|
|
|
# Force output on analog
|
|
|
|
amixer cset numid=3 1
|
|
|
|
|
|
|
|
files=(${MUSIC}*)
|
|
|
|
|
|
|
|
while true; do
|
2017-02-06 23:25:24 +01:00
|
|
|
# -id flags set interface to "dumb" and -qq silences most/all terminal output
|
|
|
|
$TIMIDITY -idqq ${files[RANDOM % ${#files[@]}]}
|
2015-11-06 17:40:33 +01:00
|
|
|
done
|