commit ad82b4bcf7edcd4e9887428672696e19c339d0a3
parent af1e5c91b57090b780602c6a83a44b0eec04f14e
Author: Ed van Bruggen <ed@edryd.org>
Date: Tue, 26 Dec 2017 16:18:08 -0800
Add quit command
Diffstat:
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
@@ -13,6 +13,7 @@ progs = browse \
man \
menu \
prog \
+ quit \
todo \
win \
diff --git a/README.md b/README.md
@@ -7,6 +7,7 @@
* [man](man): open man page in terminal
* [menu](menu): select different programs or dmenu scripts
* [prog](prog): launch program
+ * [quit](quit): select logout, reboot, shutdown, or lock
* [todo](todo): view, add or delete todos from a file
* [win](win): focus on an open window
diff --git a/menu b/menu
@@ -36,8 +36,7 @@ case $cmd in
*top)
st -g 68x6 -e htop ;;
*exit)
- # dmenu_quit ;;
- cbpp-exit ;;
+ dmenu_quit -c ;;
*)
$cmd
esac
diff --git a/quit b/quit
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+menu_list="cancel\nsuspend\nshutdown\nreboot\nlock"
+sel=$(echo -e "$menu_list" | dmenu $@ -i -l 5)
+
+case "$sel" in
+ cancel) exit ;;
+ suspend) systemctl suspend & ;;
+ shutdown) systemctl poweroff & ;;
+ reboot) systemctl reboot & ;;
+ lock) slock & ;;
+esac