mirror of
https://github.com/basecamp/omarchy.git
synced 2025-07-27 12:19:24 +00:00
37 lines
671 B
Bash
Executable File
37 lines
671 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Power menu for Omarchy
|
|
# Provides power off, restart, and sleep options
|
|
|
|
# Function to show power menu
|
|
show_power_menu() {
|
|
local menu_options=" Lock
|
|
Sleep
|
|
Restart
|
|
Shutdown"
|
|
|
|
# Show menu and get selection
|
|
local selection=$(echo -e "$menu_options" | wofi --show dmenu --prompt "Power Options" --width 200 --height 210)
|
|
|
|
if [ -n "$selection" ]; then
|
|
case "$selection" in
|
|
" Shutdown")
|
|
systemctl poweroff
|
|
;;
|
|
" Restart")
|
|
systemctl reboot
|
|
;;
|
|
" Sleep")
|
|
systemctl suspend
|
|
;;
|
|
" Lock")
|
|
hyprlock
|
|
;;
|
|
*) ;;
|
|
esac
|
|
fi
|
|
}
|
|
|
|
# Main execution
|
|
show_power_menu
|