]> gitweb.fluxo.info Git - utils-x11.git/commitdiff
Xalarm: display iteration number at loop mode
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 26 May 2018 13:46:05 +0000 (10:46 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 26 May 2018 13:46:05 +0000 (10:46 -0300)
xalarm

diff --git a/xalarm b/xalarm
index 8fbf48247b46693edd301a24f62bbd6c92e90ed1..575cc58bacd8ef366e77b52ee89bd0e36e72d9ac 100755 (executable)
--- a/xalarm
+++ b/xalarm
@@ -30,7 +30,7 @@ function xalarm_set {
 
   # Sleep implementation
   sleep $DELAY
-  if which sm 2> /dev/null; then
+  if which sm &> /dev/null; then
     sm -f '#ffffff' -b '#1c1c1c' $MESSAGE
   else
     xmessage $MESSAGE
@@ -64,9 +64,12 @@ elif [ "$1" == "cancel" ] || [ "$1" == "kill" ]; then
 elif [ "$1" == "help" ] || [ "$1" == "usage" ]; then
   xalarm_usage
 elif [ "$1" == "loop" ]; then
+  count="0"
+
   shift
   while true; do
-    xalarm_set $*
+    let count++
+    xalarm_set $* $count
   done
 else
   xalarm_set $*