diff options
| author | Don Williams <don.e.williams@gmal.com> | 2026-08-28 15:45:52 -0400 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2026-08-29 21:41:57 -0700 |
| commit | 9d6117b59a061e575f84bf0116c2c749a5e4396e (patch) | |
| tree | 5a8d4f0025d1bdb1c3595ffdcfb611433e6c5fc1 /config | |
| parent | 2b8b39347ae17c00b74fd798206cf4700374554d (diff) | |
Fix x2 for logout issue
Signed-off-by: Don Williams <don.e.williams@gmal.com>
On branch development
Your branch is up to date with 'origin/development'.
Changes to be committed:
modified: config/hypr/scripts/Logout.sh
Diffstat (limited to 'config')
| -rwxr-xr-x | config/hypr/scripts/Logout.sh | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/config/hypr/scripts/Logout.sh b/config/hypr/scripts/Logout.sh index af048f59..c9d1b274 100755 --- a/config/hypr/scripts/Logout.sh +++ b/config/hypr/scripts/Logout.sh @@ -99,27 +99,15 @@ if [ -n "$LOGINCTL_BIN" ] && [ -n "${XDG_SESSION_ID:-}" ]; then fi fi -TIMEOUT_BIN="$(command -v timeout || true)" - -# Preferred path: synchronous hyprshutdown (with timeout to prevent hanging), so script does not silently stall. -if [ -n "$HYPRSHUTDOWN_BIN" ]; then - if [ -n "$TIMEOUT_BIN" ]; then - SHUTDOWN_CMD=("$TIMEOUT_BIN" "2s" "$HYPRSHUTDOWN_BIN" "--no-fork") - else - SHUTDOWN_CMD=("$HYPRSHUTDOWN_BIN" "--no-fork") - fi - if run_logged "hyprshutdown-no-fork" "${SHUTDOWN_CMD[@]}"; then +# Primary exit path: tell Hyprland to exit cleanly +if [ -n "$HYPRCTL_BIN" ]; then + if run_logged "hyprctl-dispatch-exit" "$HYPRCTL_BIN" dispatch exit; then if logout_completed; then exit 0 fi - log_msg "hyprshutdown returned success but Hyprland is still running" - else - log_msg "hyprshutdown failed or timed out, falling back to direct exit dispatchers" + log_msg "hyprctl dispatch exit returned but Hyprland is still running" fi -fi -# Try Hyprland exit dispatchers (Lua workflow first, then Hyprlang) -if [ -n "$HYPRCTL_BIN" ]; then if run_logged "hyprctl-dispatch-lua-exit" "$HYPRCTL_BIN" dispatch 'hl.dsp.exit()'; then if logout_completed; then exit 0 @@ -127,13 +115,6 @@ if [ -n "$HYPRCTL_BIN" ]; then log_msg "hyprctl dispatch 'hl.dsp.exit()' returned but Hyprland is still running" fi - if run_logged "hyprctl-dispatch-exit" "$HYPRCTL_BIN" dispatch exit; then - if logout_completed; then - exit 0 - fi - log_msg "hyprctl dispatch exit returned but Hyprland is still running" - fi - if run_logged "hyprctl-dispatch-exit-1" "$HYPRCTL_BIN" dispatch exit 1; then if logout_completed; then exit 0 @@ -156,6 +137,21 @@ if [ -n "$HYPRCTL_BIN" ]; then fi fi +# Secondary path: hyprshutdown with kill timeout if hyprctl dispatch did not exit +if [ -n "$HYPRSHUTDOWN_BIN" ]; then + if [ -n "$TIMEOUT_BIN" ]; then + SHUTDOWN_CMD=("$TIMEOUT_BIN" "-k" "1s" "2s" "$HYPRSHUTDOWN_BIN" "--no-fork") + else + SHUTDOWN_CMD=("$HYPRSHUTDOWN_BIN" "--no-fork") + fi + if run_logged "hyprshutdown-no-fork" "${SHUTDOWN_CMD[@]}"; then + if logout_completed; then + exit 0 + fi + log_msg "hyprshutdown returned success but Hyprland is still running" + fi +fi + # systemd session fallback. if [ -n "$LOGINCTL_BIN" ] && [ -n "${XDG_SESSION_ID:-}" ]; then if [ "$IS_SDDM_SESSION" -eq 1 ]; then |
