2024-04-23 04:34:15 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
options=(
|
|
|
|
" Lock"
|
|
|
|
" Renew dwm"
|
|
|
|
" Leave dwm"
|
|
|
|
" Shutdown"
|
|
|
|
" Reboot"
|
2024-05-11 13:29:30 +02:00
|
|
|
" Suspend"
|
2024-04-23 04:34:15 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
commands=(
|
2024-04-25 08:43:27 +02:00
|
|
|
"slock"
|
2024-04-23 04:34:15 +02:00
|
|
|
"renew-dwm"
|
|
|
|
"kill -TERM $(pidof -s dwm)"
|
|
|
|
"systemctl poweroff -i"
|
|
|
|
"systemctl reboot -i"
|
2024-05-11 13:29:30 +02:00
|
|
|
"xset dpms force suspend"
|
2024-04-23 04:34:15 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
if prompt=$(printf '%s\n' "${options[@]}" | dmenu -i -bw 2 -g 1 -l 9 -W 200 -X 1151 -Y 15); then
|
|
|
|
selected_index=$(printf '%s\n' "${options[@]}" | grep -xn "$prompt" | cut -d ":" -f 1)
|
|
|
|
${commands[$selected_index - 1]}
|
|
|
|
fi
|