blob: 0a7de918a577092af87dbcde24736314879fdefd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#!/bin/sh
# Keyboard-driven power menu via wofi --dmenu (j/k navigation).
set -eu
# Suspend entry intentionally omitted while suspend is disabled
# system-wide. See etc/systemd/logind.conf.d/20-no-suspend.conf.
choice=$(printf '%s\n' \
" Lock" \
" Logout" \
" Reboot" \
" Poweroff" |
wofi --dmenu --prompt='power' \
--matching=fuzzy --insensitive \
--style "$HOME/.config/wofi/style.css")
case "$choice" in
*Lock)
playerctl -a pause
exec swaylock -f -e -c 000000
;;
*Logout) exec swaymsg exit ;;
*Reboot) exec systemctl reboot ;;
*Poweroff) exec systemctl poweroff ;;
esac
|