Auto-adapts sway workspace routing to however many monitors are connected (laptop vs. desktop) instead of hardcoding output names.
16 lines
360 B
Bash
Executable File
16 lines
360 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -Eeuo pipefail
|
|
|
|
choice=$(
|
|
printf '%s\n' 'Lock' 'Logout' 'Suspend' 'Reboot' 'Shut down' \
|
|
| wofi --dmenu --prompt 'Power' --width 320 --height 300
|
|
) || exit 0
|
|
|
|
case "$choice" in
|
|
Lock) swaylock -f ;;
|
|
Logout) swaymsg exit ;;
|
|
Suspend) systemctl suspend ;;
|
|
Reboot) systemctl reboot ;;
|
|
'Shut down') systemctl poweroff ;;
|
|
esac
|