added wlogout and wofi manager

This commit is contained in:
Jürg Hallenbarter
2026-01-26 10:00:05 +00:00
parent b747e8c177
commit 5b89a10f3a
3 changed files with 12 additions and 12 deletions

View File

@@ -1,12 +1,10 @@
#!/bin/sh
# Fullscreen overlay menu
OPTIONS="Reboot\nShutdown\nLock Screen\nCancel"
CHOICE=$(echo -e $OPTIONS | rofi -dmenu -fullscreen -p "Action" -lines 4 -bw 2 -kb-accept-entry 'Return' -kb-cancel 'Escape')
# Get screen resolution
res_w=$(xdpyinfo | awk '/dimensions/{print $2}' | cut -d'x' -f1)
res_h=$(xdpyinfo | awk '/dimensions/{print $2}' | cut -d'x' -f2)
case "$CHOICE" in
"Reboot") systemctl reboot ;;
"Shutdown") systemctl poweroff ;;
"Lock Screen") i3lock ;;
"Cancel"|"") exit 0 ;;
esac
# Compute margins if needed
w_margin=$((res_w / 4))
h_margin=$((res_h / 4))
# Launch wlogout with margins
wlogout -T $h_margin -B $h_margin