Wednesday, February 15, 2006

Using more dcop

I decided to remove all instances of simple command line amarok calls, and replace them with dcop calls. This seems to "fix" some problems. At least it does with the alarmscript. Well... it doesn't make it perfect, but it does make it more predictable, which is nice:)

alarmscript1.sh is now:

DISPLAY=:0.0
export DISPLAY
aumix -v 20
dcop amarok player enableRandomMode true
dcop amarok playlist clearPlaylist
dcop amarok player stop
dcop amarok playlist addMedia file:///home/paithan/Awaken.m3u
dcop amarok player setVolume 100
dcop amarok player play
firefox http://www.wunderground.com/cgi-bin/findweather/getForecast?query=Boston%2C+M

Which seems to work just fine. It is annoying that it tells firefox to head to the wunderground page from whichever firefox browser tab is active in some instance of firefox... I'd rather it just start a new window... but whatever. I can worry about that later.

I made the same changes to sleepscript, but it hasn't seem to have helped. Here's the new sleepscript:

killall -9 firefox
DISPLAY=:0.0
export DISPLAY
aumix -v 6
dcop amarok player enableRandomMode true
dcop amarok playlist clearPlaylist
dcop amarok player stop
dcop amarok playlist addMedia file:///home/paithan/Sleep.m3u
dcop amarok player play
for i in $(seq 101)
do
j=$((101-i))
dcop amarok player setVolume $j
sleep 10
done
dcop amarok player stop

This has the following problems:
If amaroK is playing, it dies, and kills amaroK.
If amaroK is running but not playing, it dies, killing amaroK.
If amaroK is not running, it does nothing.

...hmmm, perhaps this script is just junked now.
...
Okay, some more tests have revealed that some of the calls to firefox may be behind the problem. If these calls do not resolve happily, then the whole script becomes unhappy. Is there a way to make this a bit more roboost... er... robust?

This appears to be even more prevalent with the alarmscript now that I've been messing around with my firefox tabs. It seems like one of those calls just keeps on dying. I'm not sure, though... it could be something with amaroK.

I removed the call to kill firefox from sleepscript, and it appears to be working fine now. I'll update if I have difficulties with that again. I'm going to try more alarmscripts, without having any browser windows open... see what happens.

Wish me luck:)

0 Comments:

Post a Comment

<< Home