Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I wrote some utility interactive scripts and want them run before shutdown.

For a terminal-login session, I just add some entry in ~/.bash_logout, my login shell is bash BTW, which works. However, I can't figure out how to configure in GNOME session -- How to run an interactive script before shutdown in a GNOME session -- even don't know is it possible. After searching the Internet, I find that /etc/gdm/PostSession/Default will be used to customize logout GNOME session. However, as stated on the main page

When a user terminates their session, GDM will run the PostSession script.
Note that the Xserver will have been stopped by the time this script is run,
so it should not be accessed.

It's not proper given the scripts are interactive.

Hope someone could give me a hand on this. Any hints will be high appreciated.

Thanks and Best regards.

share|improve this question
    
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.