initial commit
This commit is contained in:
33
.config/waybar/scripts/pomodoro-preset.sh
Executable file
33
.config/waybar/scripts/pomodoro-preset.sh
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
STATE_FILE="/tmp/pomodoro-preset"
|
||||
|
||||
if ! command -v waybar-module-pomodoro >/dev/null 2>&1; then
|
||||
echo "Error: waybar-module-pomodoro is not installed or not in PATH." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
current="A"
|
||||
if [[ -f "$STATE_FILE" ]]; then
|
||||
read -r current < "$STATE_FILE" || current="A"
|
||||
fi
|
||||
|
||||
if [[ "$current" == "A" ]]; then
|
||||
next="B"
|
||||
work=50
|
||||
short=10
|
||||
long=20
|
||||
else
|
||||
next="A"
|
||||
work=25
|
||||
short=5
|
||||
long=15
|
||||
fi
|
||||
|
||||
waybar-module-pomodoro set-work "$work"
|
||||
waybar-module-pomodoro set-short "$short"
|
||||
waybar-module-pomodoro set-long "$long"
|
||||
|
||||
printf '%s\n' "$next" > "$STATE_FILE"
|
||||
Reference in New Issue
Block a user