Add explicit reboot + shutdown scripts that close all windows first (and allow a second to save state)

This commit is contained in:
David Heinemeier Hansson
2025-11-25 15:07:20 +01:00
parent 9524259765
commit a996438eaf
3 changed files with 14 additions and 2 deletions

6
bin/omarchy-cmd-reboot Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
omarchy-state clear re*-required
omarchy-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly
systemctl reboot --no-wall

6
bin/omarchy-cmd-shutdown Executable file
View File

@@ -0,0 +1,6 @@
#!/bin/bash
omarchy-state clear re*-required
omarchy-hyprland-window-close-all
sleep 1 # Allow apps like Chrome to shutdown correctly
systemctl poweroff --no-wall

View File

@@ -438,8 +438,8 @@ show_system_menu() {
*Lock*) omarchy-lock-screen ;; *Lock*) omarchy-lock-screen ;;
*Screensaver*) omarchy-launch-screensaver force ;; *Screensaver*) omarchy-launch-screensaver force ;;
*Suspend*) systemctl suspend ;; *Suspend*) systemctl suspend ;;
*Restart*) omarchy-state clear re*-required && systemctl reboot --no-wall ;; *Restart*) omarchy-cmd-reboot ;;
*Shutdown*) omarchy-state clear re*-required && systemctl poweroff --no-wall ;; *Shutdown*) omarchy-cmd-shutdown ;;
*) back_to show_main_menu ;; *) back_to show_main_menu ;;
esac esac
} }