diff options
author | lonkaars <loek@pipeframe.xyz> | 2024-03-12 10:19:24 +0100 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2024-03-12 10:19:24 +0100 |
commit | 501dd5505d950d89f5b4d0ad8249c38c36a102da (patch) | |
tree | ababe6702dbdcc19467167c8043cd7d2a5a12fcb /core/update | |
parent | d3b396b17602ad71a62cbc2eaf595a1d94579c4a (diff) |
replace hard-coded breaks with plugin
Diffstat (limited to 'core/update')
-rw-r--r-- | core/update | 12 |
1 files changed, 7 insertions, 5 deletions
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 |