aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/powerdialog
diff options
context:
space:
mode:
authorNPScript <nathan@reinerweb.ch>2022-04-09 21:22:20 +0200
committerNPScript <nathan@reinerweb.ch>2022-04-09 21:22:20 +0200
commit896c311feb10e947c727a888308dbc7eb71d1ec2 (patch)
treeb6713478d14eb8ea531107c3f399c437db7fd2fb /.local/bin/powerdialog
init commit
Diffstat (limited to '.local/bin/powerdialog')
-rwxr-xr-x.local/bin/powerdialog15
1 files changed, 15 insertions, 0 deletions
diff --git a/.local/bin/powerdialog b/.local/bin/powerdialog
new file mode 100755
index 0000000..642c45f
--- /dev/null
+++ b/.local/bin/powerdialog
@@ -0,0 +1,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" "⏻"