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.