clone of my dotfiles.ssp.sh
1
fork

Configure Feed

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

adding shutdown and reboot option that shuts open neovim sessions

sspaeti bff5b2b3 ab8e38e5

+47
+47
hypr/.config/hypr/sspaeti/omarchy-system-menu
··· 1 + #!/bin/bash 2 + 3 + # Custom system menu with tmux-aware shutdown/restart 4 + # Replaces omarchy-menu system functionality with proper tmux handling 5 + # FIXED 1-2 minutes shutdown as an tangling Neovim session is not closing as file is unsaved 6 + 7 + export PATH="$HOME/.local/share/omarchy/bin:$PATH" 8 + 9 + menu() { 10 + local prompt="$1" 11 + local options="$2" 12 + local extra="$3" 13 + 14 + read -r -a args <<<"$extra" 15 + echo -e "$options" | walker --dmenu --theme dmenu_250 -p "$prompt…" "${args[@]}" 16 + } 17 + 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 27 + } 28 + 29 + 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 38 + } 39 + 40 + case $(menu "System" " Lock\n󱄄 Screensaver\n󰤄 Suspend\n Relaunch\n󰜉 Restart\n󰐥 Shutdown") in 41 + *Lock*) omarchy-lock-screen ;; 42 + *Screensaver*) omarchy-launch-screensaver force ;; 43 + *Suspend*) systemctl suspend ;; 44 + *Relaunch*) uwsm stop ;; 45 + *Restart*) handle_tmux_and_reboot ;; 46 + *Shutdown*) handle_tmux_and_poweroff ;; 47 + esac