My dotfiles for Arch Linux
1#!/bin/bash
2options="Shutdown\nReboot\nLogout\nSuspend\nHibernate\nLock\nExit"
3chosen=$(echo -e "$options" | wofi --dmenu --prompt "Power Menu" --width 300 --height 234)
4
5case $chosen in
6 "Shutdown") systemctl poweroff ;;
7 "Reboot") systemctl reboot ;;
8 "Logout") niri msg action quit --skip-confirmation ;;
9 "Suspend") systemctl suspend ;;
10 "Hibernate") systemctl hibernate ;;
11 "Lock") swaylock ;;
12 "Exit") exit 0 ;;
13 *) exit 1 ;;
14esac