diff options
| author | Danilo M. <danix@danix.xyz> | 2026-09-18 17:08:37 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-09-18 17:08:37 +0200 |
| commit | 26f9d6ad31c1e56876e2634fbaa2f1eb217ac0c3 (patch) | |
| tree | 94b260d1fc94d4e8c316b1680ae2f3863757f285 | |
| parent | b5a767997db71e9927c1f89c0e7ead6ee7e45edb (diff) | |
| download | breaktimer-26f9d6ad31c1e56876e2634fbaa2f1eb217ac0c3.tar.gz breaktimer-26f9d6ad31c1e56876e2634fbaa2f1eb217ac0c3.zip | |
feat: add a config verb printing effective settings
Durations were unobservable at runtime: status reports phase and seconds
left, not the configuration those came from, so 'did my config take effect'
could only be answered by reading the script.
It also gives the config test something to assert against without running a
thirty minute work block.
| -rwxr-xr-x | breaktimer.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/breaktimer.sh b/breaktimer.sh index 7c8bfa3..04dbaa9 100755 --- a/breaktimer.sh +++ b/breaktimer.sh @@ -247,6 +247,16 @@ case "$1" in echo "paused" > "$STATE_FILE"; echo "breaktimer: sospeso" fi ;; + config) + printf 'MICRO_MIN=%s\nBREAK_MIN=%s\nLONG_MIN=%s\nLONG_EVERY=%s\n' \ + "$MICRO_MIN" "$BREAK_MIN" "$LONG_MIN" "$LONG_EVERY" + printf 'WORK_START=%s\nWORK_STOP=%s\n' "$WORK_START" "$WORK_STOP" + printf 'URGENCY_MICRO=%s\nURGENCY_LONG=%s\n' "$URGENCY_MICRO" "$URGENCY_LONG" + printf 'SOUND_MICRO=%s\nSOUND_LONG=%s\nSOUND_BACK=%s\n' \ + "$SOUND_MICRO" "$SOUND_LONG" "$SOUND_BACK" + printf 'CONFIG_FILE=%s\n' "$CONFIG_FILE" + [ -f "$CONFIG_FILE" ] && printf 'CONFIG_LOADED=yes\n' || printf 'CONFIG_LOADED=no\n' + ;; status) if is_running; then echo "breaktimer: attivo (PID $(cat "$PID_FILE")), stato: $(cat "$STATE_FILE" 2>/dev/null), fase: $(cat "$PHASE_FILE" 2>/dev/null), rimane: $(cat "$REMAIN_FILE" 2>/dev/null)s" @@ -255,7 +265,7 @@ case "$1" in fi ;; *) - echo "uso: $0 [start|stop|restart|pause|resume|toggle|status]" + echo "uso: $0 [start|stop|restart|pause|resume|toggle|status|config]" exit 1 ;; esac |
