From 79cc1bdbabe5d4a1521723de1a5b9c32a1df1c7c Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 13 Oct 2022 12:51:56 -0700 Subject: Initial commit --- README.org | 3 +++ shutdown-rofi | 24 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 README.org create mode 100755 shutdown-rofi 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 -- cgit v1.2.3-54-g00ecf