aboutsummaryrefslogtreecommitdiff
path: root/plugins/display
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/display')
-rwxr-xr-xplugins/display17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/display b/plugins/display
new file mode 100755
index 0000000..7d8441c
--- /dev/null
+++ b/plugins/display
@@ -0,0 +1,17 @@
+#!/bin/sh
+[ "$1" = "info" ] && echo "plugin to display time nicely" && exit 2
+
+. "$core_path/lib"
+. "$core_path/update"
+
+# on reset, print empty line to clear module
+if [ $lap -eq 0 ] && [ $running -eq 0 ] && [ $time = $("$prog" lap 0) ] ; then
+ echo ""
+ exit
+fi
+
+# print time in square brackets if running, else between dashes
+time="$(fmt_time $remaining)"
+[ $running -eq 1 ] && echo "[$time]" \
+ || echo "-$time-"
+