aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.org3
-rwxr-xr-xshutdown-rofi24
2 files changed, 27 insertions, 0 deletions
diff --git a/README.org b/README.org
new file mode 100644
index 0000000..d64bac9
--- /dev/null
+++ b/README.org
@@ -0,0 +1,3 @@
+#+title: Shutdown Rofi
+
+A simple little script using Rofi to create a shutdown menu.
diff --git a/shutdown-rofi b/shutdown-rofi
new file mode 100755
index 0000000..9c38827
--- /dev/null
+++ b/shutdown-rofi
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+foo=$(printf "poweroff\nreboot\nquit\nreload" | rofi -dmenu -i -no-fixed-num-lines -no-custom -p "Action")
+
+if [[ -n $foo ]]
+then
+ case "$foo" in
+ poweroff)
+ poweroff
+ ;;
+ reboot)
+ /usr/bin/reboot
+ ;;
+ quit)
+ herbstclient quit
+ ;;
+ reload)
+ herbstclient reload
+ ;;
+ *)
+ echo "Unknown command: $foo"
+ ;;
+ esac
+fi