View Single Post
dr_frost_dk's Avatar
Posts: 1,503 | Thanked: 2,688 times | Joined on Oct 2010 @ Denmark
#10
Well... trying to edit a conf to change next does not work....

but adapting my random script for my old diy alarm that would play random sounds from a folder until a random code had been entered to stop it.

Code:
#! /bin/sh
dbus-monitor --system interface='Phone.SMS',member='incoming' | while grep -q array
do
echo "SMS recieved"
dbus-send --type=method_call --dest=com.nokia.mafw.renderer.Mafw-Gst-Renderer-Plugin.gstrenderer /com/nokia/mafw/renderer/gstrenderer com.nokia.mafw.extension.set_extension_property string:volume variant:uint32:80
songdir="/home/user/MyDocs/.sounds/SMS-Random/"
sleep 3

a=$(ls "$songdir" -1 | awk 'BEGIN{srand()} {x[NR] = $0} END{print "", x[1 + int(rand() * NR)]}' | sed 's/^ *//')
mplayer -ao pulse "$songdir""$a"

sleep 1
echo "sleep done"
echo " "
done
So now i set the SMS to beep and volume 0, thinking about making a VERY fast click so i has a click before random sound, as script writes, it echoes "SMS recieved" and waits 3 secons (to clear audio from beep) turns audio up to 80%, and plays random file from folder that is specified (songdir)