From 501dd5505d950d89f5b4d0ad8249c38c36a102da Mon Sep 17 00:00:00 2001 From: lonkaars Date: Tue, 12 Mar 2024 10:19:24 +0100 Subject: replace hard-coded breaks with plugin --- core/update | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core/update') diff --git a/core/update b/core/update index fbe0e86..8787754 100644 --- a/core/update +++ b/core/update @@ -1,4 +1,5 @@ #!/bin/sh +[ "$skip_libraries" ] && return export now="$(date +%s.%N)" # load current state @@ -42,10 +43,9 @@ fi [ "$time" = "0.0" ] && update_time=1 if [ $update_time -eq 1 ] ; then - time="$POMODORO_NORMAL_DURATION" - [ $(( $lap % $POMODORO_BREAK_SHORT_INTERVAL )) -eq $(( $POMODORO_BREAK_SHORT_INTERVAL - 1 )) ] && time=$POMODORO_BREAK_SHORT_DURATION - [ $(( $lap % $POMODORO_BREAK_LONG_INTERVAL )) -eq $(( $POMODORO_BREAK_LONG_INTERVAL - 1 )) ] && time=$POMODORO_BREAK_LONG_DURATION - remaining="$time" + # skip_libraries is used to prevent endless loop (see top of this file) + time=$(skip_libraries=y "$prog" lap $lap) + remaining=$time fi save_state() { @@ -84,6 +84,8 @@ save_state() { mv "$POMODORO_STATE_PATH/primary/current" "$POMODORO_STATE_PATH" } -# export state variables +# state variables export lap state time +# calculated variables +export remaining -- cgit v1.2.3