From 5b14106c4aae906c0fe907ca2e002dbb00a7707b Mon Sep 17 00:00:00 2001 From: Mitsuo Tokumori Date: Sat, 12 Oct 2024 14:26:44 +0900 Subject: Add sb-stopwatch --- public/.local/bin/stopwatch_control.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 public/.local/bin/stopwatch_control.sh (limited to 'public/.local/bin/stopwatch_control.sh') diff --git a/public/.local/bin/stopwatch_control.sh b/public/.local/bin/stopwatch_control.sh new file mode 100755 index 0000000..59a9d0e --- /dev/null +++ b/public/.local/bin/stopwatch_control.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +STATE_FILE="/tmp/sb-stopwatch.state" +signal=5 + +# signal dwmblocks to update block +send_signal() { + pkill -RTMIN+$signal dwmblocks +} + + +if [ -z "$1" ]; then + echo "Usage: $0 " + exit 1 +fi + +end_time=$(($(date +%s) + $1 * 60)) +echo "$end_time" > "$STATE_FILE" +send_signal -- cgit v1.2.3