aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/powerdialog
blob: 642c45ff50c5b8329cd7d1ab245734c5672e335f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

options() {
	selection=$(printf "Cancel\nSuspend\nPower Off\nLogout" | dmenu -p "Logout Dialog")

	[ "$selection" = "Suspend" ] && systemctl suspend && exit
	[ "$selection" = "Power Off" ] && poweroff && exit
	[ "$selection" = "Logout" ] && loginctl terminate-session self && exit
}

case $BLOCK_BUTTON in
	1) options;;
esac

printf "%s\n" "⏻"