aboutsummaryrefslogtreecommitdiff
path: root/templates/.bin/pwrman
diff options
context:
space:
mode:
Diffstat (limited to 'templates/.bin/pwrman')
-rwxr-xr-xtemplates/.bin/pwrman20
1 files changed, 20 insertions, 0 deletions
diff --git a/templates/.bin/pwrman b/templates/.bin/pwrman
new file mode 100755
index 0000000..ef0823b
--- /dev/null
+++ b/templates/.bin/pwrman
@@ -0,0 +1,20 @@
+#!/usr/bin/env zsh
+
+dmenu_fn=Roboto
+dmenu_nb="#0e2133"
+dmenu_nf="#e6e0cf"
+dmenu_sb="#7390bf"
+dmenu_sf="#0e2133"
+
+menu() {
+ dmenu -fn "$dmenu_fn" -nf "$dmenu_nf" -nb "$dmenu_nb" -sb "$dmenu_sb" -sf "$dmenu_sf" -p "$1"
+}
+
+action=$(echo "lock screen\nreboot\nshutdown" | menu "Action:")
+if [[ "$action" == "lock screen" ]]; then
+ i3lock-fancy -- scrot -z
+elif [[ "$action" == "reboot" ]]; then
+ i3-nagbar -t warning -m "Are you sure you want to reboot?" -B "Reboot" "reboot"
+elif [[ "$action" == "shutdown" ]]; then
+ i3-nagbar -t warning -m "Are you sure you want to shut down?" -B "Shut Down" "sudo shutdown -h now"
+fi