]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
Support for looping alarms such as a pomodoro timer
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 24 May 2018 22:14:07 +0000 (19:14 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 24 May 2018 22:14:07 +0000 (19:14 -0300)
xalarm

diff --git a/xalarm b/xalarm
index 9405ce1df124436c3227261596fde7a06e51c445..dd541836696deede21bce05589cb9d0c9f38f83b 100755 (executable)
--- a/xalarm
+++ b/xalarm
@@ -52,7 +52,7 @@ function xalarm_cancel {
 
 # Usage
 function xalarm_usage {
-  echo "usage: $BASENAME [list|cancel|kill|help|usage] [timedef] [message]"
+  echo "usage: $BASENAME [list|cancel|kill|help|usage|loop] [timedef] [message]"
   exit 1
 }
 
@@ -63,6 +63,11 @@ elif [ "$1" == "cancel" ] || [ "$1" == "kill" ]; then
   xalarm_cancel $2
 elif [ "$1" == "help" ] || [ "$1" == "usage" ]; then
   xalarm_usage
+elif [ "$1" == "loop" ]; then
+  shift
+  while true; do
+    xalarm_set $*
+  done
 else
   xalarm_set $*
 fi