Skip to main content
3 of 3
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/

How can I run a script during GNOME logout if I don't have admin privileges?

I want to run a script before I log out of my GNOME session, to warn myself if I have forgotten a pendrive plugged into the machine.

However, all solutions I have found have not been enough for me:

  • This similar question suggests editing the /etc/gdm/PostSession/Default file, but I don't have the permissions to do that. (And the file is currently empty on my machine, so there are no existing hooks to take advantage off)

  • I also found this post suggesting a workaround but, according to the first reply, it does not work if I shutdown the computer instead of only logging off.

hugomg
  • 6.1k
  • 5
  • 43
  • 55