Add power menu to config dir

This commit is contained in:
Fern Garden 2025-06-13 16:14:44 +08:00
parent 96c8c81fd5
commit 13fa2cca69
2 changed files with 19 additions and 1 deletions

View file

@ -191,7 +191,7 @@ binds {
Mod+Shift+P { screenshot; }
Mod+Ctrl+P { screenshot-window; }
Mod+Shift+E { spawn "power-menu"; }
Mod+Shift+E { spawn "/home/fern/.config/niri/power-menu"; }
}
workspace "browser" {

View file

@ -0,0 +1,18 @@
#!/bin/bash
SELECTION="$(printf "󰶐 Turn off displays\n󰌾 Lock\n󰤄 Suspend\n󰍃 Log out\n󰜉 Reboot\n󰐥 Shutdown" | fuzzel --dmenu -l 6 -p "Power Menu: ")"
case $SELECTION in
*"Turn off displays")
niri msg action power-off-monitors;;
*"Lock")
gtklock -d;;
*"Suspend")
loginctl suspend;;
*"Log out")
niri msg action quit -s;;
*"Reboot")
loginctl reboot;;
*"Shutdown")
loginctl poweroff;;
esac