clone of my dotfiles.ssp.sh
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

shutdown fix

sspaeti 42edcbb0 788796d6

+28 -28
+4
hypr/.config/hypr/bindings.conf
··· 36 36 #OMARCHY settings and overwrites 37 37 bind = SUPER SHIFT, K, exec, ~/.local/share/omarchy/bin/omarchy-menu-keybindings 38 38 bindd = SUPER, T, Pick new theme, exec, omarchy-menu theme 39 + 40 + unbind = SUPER, ESCAPE 41 + bindd = SUPER, ESCAPE, Power menu, exec, ~/.config/hypr/sspaeti/omarchy-system-menu 42 + 39 43 # omarchy menu 40 44 bindd = SUPER CTRL ALT, SPACE, Run commands, exec, ~/.config/hypr/sspaeti/omarchy-menu 41 45 bindd = SUPER ALT, SPACE, Run commands, exec, ~/.config/hypr/sspaeti/omarchy-menu-flat
+5 -17
hypr/.config/hypr/sspaeti/omarchy-system-menu
··· 16 16 } 17 17 18 18 handle_tmux_and_poweroff() { 19 - # Save tmux sessions and close gracefully before shutdown 20 - if command -v tmux &> /dev/null && tmux list-sessions &> /dev/null; then 21 - # Save all tmux sessions using resurrect 22 - tmux run-shell '~/.tmux/plugins/tmux-resurrect/scripts/save.sh' 23 - # Kill all tmux sessions gracefully 24 - tmux kill-server 25 - fi 26 - systemctl poweroff 19 + # Use the intercept script for tmux-aware shutdown 20 + ~/.config/hypr/sspaeti/omarchy-system-menu-intercept poweroff 27 21 } 28 22 29 23 handle_tmux_and_reboot() { 30 - # Save tmux sessions and close gracefully before restart 31 - if command -v tmux &> /dev/null && tmux list-sessions &> /dev/null; then 32 - # Save all tmux sessions using resurrect 33 - tmux run-shell '~/.tmux/plugins/tmux-resurrect/scripts/save.sh' 34 - # Kill all tmux sessions gracefully 35 - tmux kill-server 36 - fi 37 - systemctl reboot 24 + # Use the intercept script for tmux-aware reboot 25 + ~/.config/hypr/sspaeti/omarchy-system-menu-intercept reboot 38 26 } 39 27 40 - case $(menu "System" " Lock\n󱄄 Screensaver\n󰤄 Suspend\n Relaunch\n󰜉 Restart\n󰐥 Shutdown") in 28 + case $(menu "System" " Lock\n󱄄 Screensaver\n󰤄 Suspend\n Relaunch\n󰜉 Restart\n󰐥 Shutdown") in 41 29 *Lock*) omarchy-lock-screen ;; 42 30 *Screensaver*) omarchy-launch-screensaver force ;; 43 31 *Suspend*) systemctl suspend ;;
+19 -11
hypr/.config/hypr/sspaeti/omarchy-system-menu-intercept
··· 4 4 # This script wraps systemctl calls to use our custom system menu 5 5 6 6 if [[ "$1" == "poweroff" ]]; then 7 - echo "$(date): Shutdown script called - poweroff" >> /tmp/shutdown.log 7 + # Log to both journal and persistent file 8 + logger -t "omarchy-shutdown" "Shutdown script called - poweroff" 9 + echo "$(date): Shutdown script called - poweroff" >> /var/log/omarchy-shutdown.log 8 10 # Save tmux sessions and close gracefully before shutdown 9 11 if command -v tmux &> /dev/null && tmux list-sessions &> /dev/null; then 10 - echo "$(date): Found tmux sessions, saving and killing" >> /tmp/shutdown.log 12 + logger -t "omarchy-shutdown" "Found tmux sessions, saving and killing" 13 + echo "$(date): Found tmux sessions, saving and killing" >> /var/log/omarchy-shutdown.log 11 14 # Save all tmux sessions using resurrect 12 15 tmux run-shell '~/.tmux/plugins/tmux-resurrect/scripts/save.sh' 13 16 sleep 2 14 - # Kill all tmux sessions gracefully 15 - tmux kill-server 16 - echo "$(date): tmux kill-server completed" >> /tmp/shutdown.log 17 + # Kill all tmux sessions gracefully with more aggressive timeout 18 + timeout 2s tmux kill-server || logger -t "omarchy-shutdown" "tmux kill-server timed out, forcing kill" 19 + logger -t "omarchy-shutdown" "tmux kill-server completed" 20 + echo "$(date): tmux kill-server completed" >> /var/log/omarchy-shutdown.log 17 21 fi 18 22 exec /usr/bin/systemctl poweroff 19 23 elif [[ "$1" == "reboot" ]]; then 20 - echo "$(date): Shutdown script called - reboot" >> /tmp/shutdown.log 24 + # Log to both journal and persistent file 25 + logger -t "omarchy-shutdown" "Shutdown script called - reboot" 26 + echo "$(date): Shutdown script called - reboot" >> /var/log/omarchy-shutdown.log 21 27 # Save tmux sessions and close gracefully before restart 22 28 if command -v tmux &> /dev/null && tmux list-sessions &> /dev/null; then 23 - echo "$(date): Found tmux sessions, saving and killing" >> /tmp/shutdown.log 29 + logger -t "omarchy-shutdown" "Found tmux sessions, saving and killing" 30 + echo "$(date): Found tmux sessions, saving and killing" >> /var/log/omarchy-shutdown.log 24 31 # Save all tmux sessions using resurrect 25 32 tmux run-shell '~/.tmux/plugins/tmux-resurrect/scripts/save.sh' 26 33 sleep 2 27 - # Kill all tmux sessions gracefully 28 - tmux kill-server 29 - echo "$(date): tmux kill-server completed" >> /tmp/shutdown.log 34 + # Kill all tmux sessions gracefully with more aggressive timeout 35 + timeout 2s tmux kill-server || logger -t "omarchy-shutdown" "tmux kill-server timed out, forcing kill" 36 + logger -t "omarchy-shutdown" "tmux kill-server completed" 37 + echo "$(date): tmux kill-server completed" >> /var/log/omarchy-shutdown.log 30 38 fi 31 39 exec /usr/bin/systemctl reboot 32 40 else 33 41 # For all other systemctl commands, pass through normally 34 42 exec /usr/bin/systemctl "$@" 35 - fi 43 + fi