dr_frost_dk |
2014-04-05 17:36 |
Re: Random SMS sound
Success with the method of changing next SMS sound.
Code:
#! /bin/sh
dbus-monitor --system interface='Phone.SMS',member='incoming' | while grep -q array
do
echo "SMS recieved"
sleep 1
songdir="/home/user/MyDocs/.sounds/SMS-Random/"
a=$(ls "$songdir" -1 | awk 'BEGIN{srand()} {x[NR] = $0} END{print "", x[1 + int(rand() * NR)]}' | sed 's/^ *//')
sleep 5
cp "$songdir""$a" /home/user/.local/share/sounds/Message1.aac.wav
done
Select "Message1" as ringtone, 1 sms will have the stock tone, every other will have random sounds from defined folder, now just need to make a startup script so i don't have an open terminal all the time :)
|