#!/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