Skip to content

Instantly share code, notes, and snippets.

@oesmith
Created February 9, 2024 14:21
Show Gist options
  • Save oesmith/6626c86b257d53ecaa6091cf7d8195b0 to your computer and use it in GitHub Desktop.
Save oesmith/6626c86b257d53ecaa6091cf7d8195b0 to your computer and use it in GitHub Desktop.
Power menu (power off / reboot / suspend / etc) for Wayland desktops using Wofi
#!/usr/bin/env bash
op=$( echo -e " Poweroff\n Reboot\n Suspend\n Lock\n Logout" | wofi -i --dmenu --width 300 --height 200 | awk '{print tolower($2)}' )
case $op in
poweroff)
;&
reboot)
;&
suspend)
systemctl $op
;;
lock)
swaylock -f -c 000000
;;
logout)
swaymsg exit
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment