Commit: bddd3ed6d762953eb383d21c238b18f1701a5b51
Parent: 8bcd30240e136d156264fee4e171aae4c7a310d2
Author: Randy Palamar
Date: Sat, 30 Oct 2021 10:07:03 -0600
sysact: allow an action to specified at invocation
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/bin/sysact b/bin/sysact
@@ -10,9 +10,11 @@ suspend
reboot
shutdown"
-case $(echo "$options" | dmenu -i -p "Action:") in
+case ${1:-$(echo "$options" | dmenu -i -p "Action:")} in
lock) slock ;;
suspend) $SUCMD /sbin/zzz ;;
reboot) $SUCMD /sbin/shutdown -r now ;;
shutdown) $SUCMD /sbin/shutdown -h now ;;
+*) echo "usage: $0 [lock|suspend|reboot|shutdown]"
+ exit 1 ;;
esac