aboutsummaryrefslogtreecommitdiff
path: root/plugins/display
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-03-12 19:44:04 +0100
committerlonkaars <loek@pipeframe.xyz>2024-03-12 19:44:04 +0100
commita1bae69d54bfebbdb99c4beb644ebc755a75da24 (patch)
tree48507d6e3c092ce018e8e1b39887c38d2b296052 /plugins/display
parent8b0ecac59c4fa1d87167f4c1358c2662be3a63aa (diff)
add some example pluginsHEADmaster
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-"
+