From 66cfcce29d02ebfed884a76362f1df322497f89b Mon Sep 17 00:00:00 2001 From: Albert Armea Date: Thu, 1 Jan 2026 22:04:38 -0500 Subject: [PATCH] Make Sway/systemd call `shepherdd`'s graceful shutdown on logout --- sway.conf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sway.conf b/sway.conf index c80e28c..f29153d 100644 --- a/sway.conf +++ b/sway.conf @@ -44,8 +44,11 @@ input type:pointer { # Add this to kernel parameters: vt.handoff=0 # Or in /etc/systemd/logind.conf: NAutoVTs=0 and ReserveVT=0 -# Emergency exit for admin (Super+Shift+Escape) - REMOVE IN PRODUCTION -bindsym Mod4+Shift+Escape exit +# Exit keybinding - works for both nested sway (dev) and production logout +# Kill shepherdd first to ensure clean shutdown, then exit sway +# In dev: exits the nested sway instance +# In production: logs out of the session (REMOVE or change to something harder to press) +bindsym Mod4+Shift+Escape exec pkill -TERM shepherdd && swaymsg exit ### Window rules for kiosk behavior @@ -134,6 +137,7 @@ workspace 1 output * # Start shepherdd FIRST - it needs to create the socket before HUD/launcher connect # Running inside sway ensures all spawned processes use the nested compositor +# Shepherdd handles SIGHUP for graceful shutdown when sway exits exec ./target/debug/shepherdd -c ./config.example.toml # Give shepherdd a moment to initialize, then start UI components