#!/usr/bin/env bash set -euo pipefail declare -A actions actions[Reboot]="systemctl reboot" actions[Shutdown]="systemctl poweroff" SELECTION=$(printf "Reboot\nShutdown" | rofi -dmenu -p "") if [ -z "$SELECTION" ]; then exit 0 fi if [ -z "${actions[$SELECTION]:-}" ]; then notify-send "ERROR" "Invalid choice: $SELECTION" exit 1 fi notify-send "System" "Initiating $SELECTION..." sleep 0.5 ${actions[$SELECTION]}