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 --- core/help | 2 +- core/path | 2 +- core/state | 21 --------------------- core/status | 21 +++++++++++++++++++++ core/update | 3 --- 5 files changed, 23 insertions(+), 26 deletions(-) delete mode 100755 core/state create mode 100755 core/status (limited to 'core') diff --git a/core/help b/core/help index 4bc5496..56783d2 100755 --- a/core/help +++ b/core/help @@ -33,6 +33,6 @@ done | awk ' cat << EOF -if no action is provided, the \`state\` action is chosen by default +if no action is provided, the \`status\` action is chosen by default EOF diff --git a/core/path b/core/path index 23f7f5c..376059b 100644 --- a/core/path +++ b/core/path @@ -1,5 +1,5 @@ #!/bin/sh # initialize default search path for core + plugins -path="$core_path" +path="$core_path:$path" path="$XDG_DATA_HOME/$progname:$path" export path diff --git a/core/state b/core/state deleted file mode 100755 index 6aad04b..0000000 --- a/core/state +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -[ "$1" = "info" ] && echo "show timer" && exit 2 -. "$core_path/lib" - -usage() { - cat << EOF -$subcmd -- show timer - -usage: - $subcmd [options] - -options: - -h, --help show help - -actions: -EOF -} - -. "$core_path/update" -echo "lap $lap, $([ $running -eq 1 ] && echo "running" || echo "paused"), $(fmt_time $remaining)" - diff --git a/core/status b/core/status new file mode 100755 index 0000000..6aad04b --- /dev/null +++ b/core/status @@ -0,0 +1,21 @@ +#!/bin/sh +[ "$1" = "info" ] && echo "show timer" && exit 2 +. "$core_path/lib" + +usage() { + cat << EOF +$subcmd -- show timer + +usage: + $subcmd [options] + +options: + -h, --help show help + +actions: +EOF +} + +. "$core_path/update" +echo "lap $lap, $([ $running -eq 1 ] && echo "running" || echo "paused"), $(fmt_time $remaining)" + diff --git a/core/update b/core/update index 686def2..6844114 100644 --- a/core/update +++ b/core/update @@ -38,9 +38,6 @@ if [ $running -eq 1 ] && [ "${remaining#-}" != "${remaining}" ] ; then update_time=1 fi -# update remaining time if in reset -[ $lap -eq 0 ] && [ $time = '0' ] && update_time=1 - if [ $update_time -eq 1 ] ; then # skip_libraries is used to prevent endless loop (see top of this file) time=$(skip_libraries=y "$prog" lap $lap) -- cgit v1.2.3