aboutsummaryrefslogtreecommitdiff
path: root/core/pause
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-03-11 18:33:02 +0100
committerlonkaars <loek@pipeframe.xyz>2024-03-11 18:33:02 +0100
commite6c1cacb60010ec75e02cf72acf34278417670fd (patch)
tree97e8f8042f4d8461e7cec9f403787bad20ffde9e /core/pause
initial commit (basic functionality)
Diffstat (limited to 'core/pause')
-rwxr-xr-xcore/pause13
1 files changed, 13 insertions, 0 deletions
diff --git a/core/pause b/core/pause
new file mode 100755
index 0000000..a55bd30
--- /dev/null
+++ b/core/pause
@@ -0,0 +1,13 @@
+#!/bin/sh
+[ "$1" = "info" ] && echo "pause the timer" && exit 2
+
+. "$core_path/lib"
+. "$core_path/update"
+
+[ "$state" != 'running' ] && err "timer is not running"
+
+time="$("$time - $now" | bc)"
+state='paused'
+
+save_state
+