aboutsummaryrefslogtreecommitdiff
path: root/core/update
diff options
context:
space:
mode:
Diffstat (limited to 'core/update')
-rw-r--r--core/update12
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