summary refs log tree commit diff
path: root/bin/susm
diff options
context:
space:
mode:
Diffstat (limited to 'bin/susm')
-rwxr-xr-xbin/susm30
1 files changed, 30 insertions, 0 deletions
diff --git a/bin/susm b/bin/susm
new file mode 100755
index 0000000..197013a
--- /dev/null
+++ b/bin/susm
@@ -0,0 +1,30 @@
+#!/bin/bash
+set -eu
+
+# shellcheck disable=2034
+description="suspend manager"
+
+FUZL_PROMPT=susm
+. libfuzl.sh
+
+main() {
+	local action
+
+	action=$( (
+		printf '%s\t%s\n' 󰒲 'suspend'
+		printf '%s\t%s\n' 󰤁 'reboot'
+		printf '%s\t%s\n'  'poweroff'
+		printf '%s\t%s\n' 󰌾 'lock'
+	) | fuzl_menu $FUZL_MENU_FILTER --with='{1}  {2}' --accept-nth=2)
+
+	case "$action" in
+	suspend | poweroff | reboot)
+		exec loginctl $action
+		;;
+	lock)
+		exec waylock
+		;;
+	esac
+}
+
+main