I have tried this at Kubuntu 10.10 and Xubuntu 10.04.
My goal is to kill an XBMC and restart it after resume. The process should go that way:
1. Suspend command
2. XBMC killed
3. PC sleeping
4 Resume command
5 PC resuming
6 XBMC launched

OR

1. Suspend command
2. PC sleeping
3. Resume command
4. PC resuming
5 XBMC killed
6 XBMC launched

I had some troubles with killing XBMC, so I tried the script with Firefox and Krusader too. The script will kill Krusader and Firefox, but will not relaunch them.

Here is a script I tried with Firefox

Code:
sudo touch /etc/pm/sleep.d/99_restartFirefox
sudo chmod a+x /etc/pm/sleep.d/99_restartFirefox
sudo nano /etc/pm/sleep.d/99_restartFirefox
I create the following content:

[CODE]
#!/bin/bash
#
# restart Firefox
# position /etc/pm/sleep.d/99_restartFirefox

#case "$1" in
hibernate|suspend)
killall firefox-bin
;;
thaw|resume)
/usr/bin/firefox
;;
*)
;;
esac
exit $?
It seems I am missing something in the launch app command, any help