clone of my dotfiles.ssp.sh
1
fork

Configure Feed

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

add graceful shutdown with tmux

sspaeti 3e2b1a9d bff5b2b3

+45 -6
+2 -2
hypr/.config/hypr/bindings.conf
··· 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 39 # omarchy menu 40 - bindd = SUPER CTRL ALT, SPACE, Run commands, exec, ~/.local/share/omarchy/bin/omarchy-menu 40 + bindd = SUPER CTRL ALT, SPACE, Run commands, exec, ~/.config/hypr/sspaeti/omarchy-menu 41 41 bindd = SUPER ALT, SPACE, Run commands, exec, ~/.config/hypr/sspaeti/omarchy-menu-flat 42 42 # fix for using SUPER ESC on KBDFans Keyboard 43 - bind = SUPER, grave, exec, ~/.local/share/omarchy/bin/omarchy-menu-power 43 + bind = SUPER, grave, exec, ~/.config/hypr/sspaeti/omarchy-system-menu 44 44 45 45 46 46 bind = SUPER, N, exec, $toggle obsidian "obsidian --disable-gpu"
+12
hypr/.config/hypr/sspaeti/omarchy-menu
··· 1 + #!/bin/bash 2 + 3 + # Custom omarchy-menu wrapper that uses our tmux-aware system menu 4 + # This preserves the original omarchy-menu while adding custom system handling 5 + 6 + # If called with "system" argument, use our custom system menu 7 + if [[ "$1" == "system" ]]; then 8 + exec ~/.config/hypr/sspaeti/omarchy-system-menu 9 + fi 10 + 11 + # For all other cases, call the original omarchy-menu 12 + exec ~/.local/share/omarchy/bin/omarchy-menu "$@"
+4 -4
hypr/.config/hypr/sspaeti/omarchy-menu-flat
··· 358 358 *Screensaver*) omarchy-launch-screensaver force ;; 359 359 *Suspend*) systemctl suspend ;; 360 360 *Relaunch*) uwsm stop ;; 361 - *Restart*) systemctl reboot ;; 362 - *Shutdown*) systemctl poweroff ;; 361 + *Restart*) ~/.config/hypr/sspaeti/omarchy-system-menu-intercept reboot ;; 362 + *Shutdown*) ~/.config/hypr/sspaeti/omarchy-system-menu-intercept poweroff ;; 363 363 *) show_main_menu ;; 364 364 esac 365 365 } ··· 431 431 *lock*) omarchy-lock-screen ;; 432 432 *suspend*) systemctl suspend ;; 433 433 *relaunch*) uwsm stop ;; 434 - *restart*) systemctl reboot ;; 435 - *shutdown*) systemctl poweroff ;; 434 + *restart*) ~/.config/hypr/sspaeti/omarchy-system-menu-intercept reboot ;; 435 + *shutdown*) ~/.config/hypr/sspaeti/omarchy-system-menu-intercept poweroff ;; 436 436 esac 437 437 } 438 438
+27
hypr/.config/hypr/sspaeti/omarchy-system-menu-intercept
··· 1 + #!/bin/bash 2 + 3 + # Intercept script for omarchy-menu to add tmux-aware shutdown/restart 4 + # This script wraps systemctl calls to use our custom system menu 5 + 6 + if [[ "$1" == "poweroff" ]]; then 7 + # Save tmux sessions and close gracefully before shutdown 8 + if command -v tmux &> /dev/null && tmux list-sessions &> /dev/null; then 9 + # Save all tmux sessions using resurrect 10 + tmux run-shell '~/.tmux/plugins/tmux-resurrect/scripts/save.sh' 11 + # Kill all tmux sessions gracefully 12 + tmux kill-server 13 + fi 14 + exec /usr/bin/systemctl poweroff 15 + elif [[ "$1" == "reboot" ]]; then 16 + # Save tmux sessions and close gracefully before restart 17 + if command -v tmux &> /dev/null && tmux list-sessions &> /dev/null; then 18 + # Save all tmux sessions using resurrect 19 + tmux run-shell '~/.tmux/plugins/tmux-resurrect/scripts/save.sh' 20 + # Kill all tmux sessions gracefully 21 + tmux kill-server 22 + fi 23 + exec /usr/bin/systemctl reboot 24 + else 25 + # For all other systemctl commands, pass through normally 26 + exec /usr/bin/systemctl "$@" 27 + fi