Session Event Hooks
Admins who wish to execute custom actions on a session can implement event hooks that are fired when the session action occurs. These events are executed as the user of the session.
Event hooks are registered in the application.ini file for each application.
An example event hook looks like the following
[events.start]
pre[]=command1
post[]=command2
postWithTerminate[]=gnome-session-inhibit --inhibit idle:suspend:automount --app-id FastX --reason "Implemented elsewhere" --inhibit-only
[events.connect]
pre[]=
post[]=dbus-send --session --dest=org.gnome.ScreenSaver --type=method_call --print-reply --reply-timeout=5000 /org/gnome/ScreenSaver org.gnome.ScreenSaver.SetActive boolean:false
Pre Events
A pre event happens BEFORE the event is actually called. The pre event has the following properties
- Each pre script is executed in order
- pre scripts MUST exit with code 0
- Any other exit code will return an error causing the action to never be called
Post Events
A post event happens AFTER the event is actually called. The post event has the following properties
- post scripts are executed in the background
PostWithTerminate Events
A postWithTerminate event happens AFTER the event is actually called. The postWithTerminate event has the following properties
- postWithTerminate scripts are executed in the background
- postWithTerminate scripts will exit before or when the session exits