new setup

This commit is contained in:
Maximilian Wagner
2025-06-17 14:24:21 +02:00
parent 6c562f9d65
commit 665351aaac
6 changed files with 390 additions and 249 deletions

27
scripts/power-menu.sh Executable file
View File

@@ -0,0 +1,27 @@
#!/bin/bash
dmenu_command=(wofi -dmenu -p "Power Menu" -i)
# Define menu options and corresponding actions
options=(
"Lock"
"Logout"
"Shutdown"
"Reboot"
)
# Create associative array mapping text to actions
declare -A actions
actions["Lock"]="sleep 0.2 && hyprlock"
actions["Logout"]="hyprctl dispatch exit"
actions["Shutdown"]="systemctl poweroff"
actions["Reboot"]="systemctl reboot"
# Prompt user using wofi in dmenu mode
choice=$(printf '%s\n' "${options[@]}" | "${dmenu_command[@]}")
# Run the corresponding command if valid choice was made
if [[ -n "$choice" && -n "${actions[$choice]}" ]]; then
eval "${actions[$choice]}"
fi