You are not logged in.
Pages: 1
Hi,
How do I run a script on logout/restart?.
I saw some threads on using a wrapper from circa 2018.
Is there now a dedicated file to edit?.
Thanks
Offline
If you add a new Autostart item under Settings --> Session and Startup --> tab "Autostart Applications", you can specify at which time you want it to run--this includes logout and restart, among others.
Nanos gigantum humeris insidentes.
Offline
Thanks.
I'm familiar with the autostart folder, but where do scripts which run on logout go?.
Cheers
Offline
OK, I've found that adding
RunHook=<value>
to the associated file in ~/.config/autostart would do the trick, where <value> the events and values are:
login 0, logout 1, shutdown 2, restart 3, suspend 4, hibernate 5, hybrid sleep 6, switch user 7.
Offline
You can also do this via the dialog at Settings Manager > Session and Startup > Autostart Applications. For each entry, click on the Trigger column and you will get a dropdown to set the RunHook values.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Thanks.
Is it possible to have multiple hooks, e.g. a script should run on logout + shutdown + restart?.
Or does this require separate entries?.
Offline
Answered in the other thread you posted to. At this time no, but it would be a good enhancement to the code if we could have something like a "session exit" entry. Perhaps you could open an enhancement request.
Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki | Community | Contribute ---
Offline
Thanks.
Offline
Pages: 1
[ Generated in 0.011 seconds, 7 queries executed - Memory usage: 536.02 KiB (Peak: 536.87 KiB) ]