aboutsummaryrefslogtreecommitdiff
path: root/xalarm
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2018-05-26 10:46:05 -0300
committerSilvio Rhatto <rhatto@riseup.net>2018-05-26 10:46:05 -0300
commitea0e02a5e78021c545902fc0ad61a0eccf9c24e5 (patch)
tree0c949d143e1c6fcad93d275be4e4d1edf37c3507 /xalarm
parentd831c31bcc68fd65522c1908e101d12dc960f73a (diff)
downloadutils-x11-ea0e02a5e78021c545902fc0ad61a0eccf9c24e5.tar.gz
utils-x11-ea0e02a5e78021c545902fc0ad61a0eccf9c24e5.tar.bz2
Xalarm: display iteration number at loop mode
Diffstat (limited to 'xalarm')
-rwxr-xr-xxalarm7
1 files changed, 5 insertions, 2 deletions
diff --git a/xalarm b/xalarm
index 8fbf482..575cc58 100755
--- 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 $*