From a1bae69d54bfebbdb99c4beb644ebc755a75da24 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 12 Mar 2024 19:44:04 +0100 Subject: add some example plugins --- plugins/display | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 plugins/display (limited to 'plugins/display') 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-" + -- cgit v1.2.3