Is it possible to run a script/command when the xfce session stops ?
Change the /usr/bin/xfce4-session
executable with a shell script which runs the original xfce4-session
and your logout script if xfce4-session
finished.
# mv /usr/bin/xfce4-session /usr/bin/xfce4-session.orig
The new /usr/bin/xfce4-session
file:
#!/bin/bash
/usr/bin/xfce4-session.orig
echo "my logout script" > /tmp/testfile
Don't forget to set the execute permissions:
# chmod a+x /usr/bin/xfce4-session
(Tested on Debian Squeeze.)