#!/bin/bash

show_power_menu() {
  # The first characters are invisible sort keys.
  local menu_options=" Lock
󱄄 Save
󰤄 Suspend
 Relaunch
󰜉 Restart
󰐥 Shutdown"
  local selection=$(echo -e "$menu_options" | walker --dmenu --theme dmenu_150)

  case "$selection" in
  *Lock*) hyprlock ;;
  *Save*) ~/.local/share/omarchy/bin/omarchy-launch-screensaver ;;
  *Suspend*) systemctl suspend ;;
  *Relaunch*) uwsm stop ;;
  *Restart*) systemctl reboot ;;
  *Shutdown*) systemctl poweroff ;;
  esac
}

show_power_menu
