Run a script with user interaction on log out / shutdown?

Posted by lumbric on Ask Ubuntu See other posts from Ask Ubuntu or by lumbric
Published on 2012-06-17T14:21:07Z Indexed on 2012/06/17 15:24 UTC
Read the original article Hit count: 214

Filed under:
|
|

I'd like to run a script on shut down, which interrupts the logout process and and pops up a window with zenity. My target is to get autofsck working with lightdm. It seems to work with 12.04 after installing the old *.deb file, if one runs the check script manually. In order to use it, it should run automatically on log out and ask the user if she/he wants to check the disc on shutdown.

There is the option session-cleanup-script in the file /etc/lightdm/lightdm.conf which seems to work, if a bash file with full path is used (I can't place the command directly there). But if I press shutdown, there is no time for a user choice.

Is there any other option to solve this problem?

© Ask Ubuntu or respective owner

Related posts about lightdm

Related posts about logout