When I resume my laptop and had radiotray turned on it starts playing again (from buffer) while I'm on the lock screen. This gets really annoying when I'm somewhere it should be quiet (library, train etc.). It would also be nice to have some delay in resuming radiotray playback after unlocking the screen to be able to react to the situation I'm in.
How do I prevent that behaviour (ok, besides turning radiotray off before suspending)?
Running 10.04, as a workaround to avoid this quite annoying behaviour, I put together the script below and saved it as /etc/pm/sleep.d/13_radiotray.
(In terminal:
gksudo gedit /etc/pm/sleep.d/13_radiotray
, enter/paste the script code, save the file and finally make it executable with:sudo chmod +x /etc/pm/sleep.d/13_radiotray
.)As you can see, what it does is: if radiotray was running on suspend/hibernate, it gets killed on resume/thaw and then restarted in "idle" mode. This works OK for me and my needs...
(I don't know if the numbering (13...) of the script is "OK", if the final "exit $?" is necessary - or of any use at all? - but at least it works perfectly for me...)
Edited 2012-11-03: changed the "DISPLAY=: ..." line (see comment below) /mikwie