diff options
Diffstat (limited to 'public/.local/bin/stopwatch_control.sh')
| -rwxr-xr-x | public/.local/bin/stopwatch_control.sh | 19 |
1 files changed, 19 insertions, 0 deletions
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 <minutes>" + exit 1 +fi + +end_time=$(($(date +%s) + $1 * 60)) +echo "$end_time" > "$STATE_FILE" +send_signal |
