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 questionThis similar question suggests editing the
/etc/gdm/PostSession/Defaultfile, 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.