summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/lightdm.conf2
-rw-r--r--src/seat.c2
-rw-r--r--tests/scripts/script-hooks.conf9
3 files changed, 12 insertions, 1 deletions
diff --git a/data/lightdm.conf b/data/lightdm.conf
index 188bae8a..2b3251a8 100644
--- a/data/lightdm.conf
+++ b/data/lightdm.conf
@@ -60,6 +60,7 @@
# session-wrapper = Wrapper script to run session with
# greeter-wrapper = Wrapper script to run greeter with
# display-setup-script = Script to run when starting a greeter session (runs as root)
+# display-stopped-script = Script to run after stopping the display server (runs as root)
# greeter-setup-script = Script to run when starting a greeter (runs as root)
# session-setup-script = Script to run when starting a user session (runs as root)
# session-cleanup-script = Script to run when quitting a user session (runs as root)
@@ -96,6 +97,7 @@
#session-wrapper=lightdm-session
#greeter-wrapper=
#display-setup-script=
+#display-stopped-script=
#greeter-setup-script=
#session-setup-script=
#session-cleanup-script=
diff --git a/src/seat.c b/src/seat.c
index 6cfedaa9..e5c03b54 100644
--- a/src/seat.c
+++ b/src/seat.c
@@ -339,13 +339,13 @@ get_start_local_sessions (Seat *seat)
static void
display_server_stopped_cb (DisplayServer *display_server, Seat *seat)
{
+ const gchar *script;
GList *list, *link;
Session *active_session;
l_debug (seat, "Display server stopped");
/* Run a script right after stopping the display server */
- const gchar *script;
script = seat_get_string_property (seat, "display-stopped-script");
if (script)
run_script (seat, NULL, script, NULL);
diff --git a/tests/scripts/script-hooks.conf b/tests/scripts/script-hooks.conf
index dc573bab..0334b9af 100644
--- a/tests/scripts/script-hooks.conf
+++ b/tests/scripts/script-hooks.conf
@@ -4,6 +4,7 @@
[SeatDefaults]
display-setup-script=test-script-hook DISPLAY-SETUP
+display-stopped-script=test-script-hook DISPLAY-STOPPED
greeter-setup-script=test-script-hook GREETER-SETUP
session-setup-script=test-script-hook SESSION-SETUP
session-cleanup-script=test-script-hook SESSION-CLEANUP
@@ -38,6 +39,9 @@ user-session=default
# X server stops
#?XSERVER-0 TERMINATE SIGNAL=15
+# Script hooks run
+#?SCRIPT-HOOK DISPLAY-STOPPED
+
# X server starts
#?XSERVER-0 START VT=7
@@ -61,4 +65,9 @@ user-session=default
#?*STOP-DAEMON
#?GREETER-X-0 TERMINATE SIGNAL=15
#?XSERVER-0 TERMINATE SIGNAL=15
+
+# Script hooks run
+#?SCRIPT-HOOK DISPLAY-STOPPED
+
+# Finish cleanup
#?RUNNER DAEMON-EXIT STATUS=0