diff options
| -rw-r--r-- | README.md | 49 |
1 files changed, 39 insertions, 10 deletions
@@ -50,8 +50,8 @@ Defaults use the [Modern Minimal UI](https://github.com/cadecomposer/modern-mini Three events map to `message-new-instant.oga` (micro), `alarm-clock-elapsed.oga` (long), `service-login.oga` (back to work). Don't have that set? Either install -it there, or edit the `SOUND_DIR` / `SYS_SOUND_*` variables at the top of -`breaktimer.sh` to point at any `.oga`/`.wav` you like (e.g. the freedesktop +it there, or set `SOUND_DIR` / `SYS_SOUND_*` in `~/.config/breaktimer.conf` +(see Configuration below) to point at any `.oga`/`.wav` you like (e.g. the freedesktop sounds in `/usr/share/sounds/freedesktop/stereo/`). A missing file is simply silent — no error. @@ -65,6 +65,7 @@ breaktimer.sh pause # freeze the countdown breaktimer.sh resume # unfreeze breaktimer.sh toggle # pause/resume in one command breaktimer.sh status # print state, phase, seconds remaining +breaktimer.sh config # print the effective settings ``` (`breaktimer.sh run` is the internal loop — don't call it directly; it will @@ -78,15 +79,43 @@ stale PID file from a previous session is taken over, not duplicated. ## Configuration -Edit the variables at the top of `breaktimer.sh`: +Defaults live at the top of `breaktimer.sh`. To change them without editing a +tracked file, write `~/.config/breaktimer.conf` (or +`$XDG_CONFIG_HOME/breaktimer.conf`). It is sourced as shell, so it is a list of +assignments, and it need only name what it changes: -| Variable | Meaning | -|-------------------------------|-------------------------------------------| -| `MICRO_MIN` / `BREAK_MIN` | work block / micro-pause length (minutes) | -| `LONG_MIN` / `LONG_EVERY` | long-pause length / every N-th block | -| `WORK_START` / `WORK_STOP` | work-hours window (`HH:MM`); outside it the work countdown freezes | -| `URGENCY_MICRO` / `URGENCY_LONG` | dunst urgency (`low`/`normal`/`critical`) | -| `SOUND_DIR`, `SOUND_*`, `SYS_SOUND_*` | sound files (see above) | +```bash +MICRO_MIN=25 +BREAK_MIN=5 +WORK_START="08:30" +SOUND_MICRO="$HOME/Music/notify/pausetta.opus" +``` + +| variable | default | meaning | +|---|---|---| +| `MICRO_MIN` | 30 | minutes of work between breaks | +| `BREAK_MIN` | 3 | length of a micro-pause | +| `LONG_MIN` | 10 | length of a long pause | +| `LONG_EVERY` | 4 | a long pause instead of every Nth micro-pause | +| `WORK_START` | 09:00 | countdown freezes before this | +| `WORK_STOP` | 18:30 | countdown freezes after this | +| `URGENCY_MICRO` | normal | notify-send urgency for a micro-pause | +| `URGENCY_LONG` | critical | notify-send urgency for a long pause | +| `SOUND_MICRO` | unset | sound for a micro-pause, falls back to `SYS_SOUND_MICRO` | +| `SOUND_LONG` | unset | sound for a long pause, falls back to `SYS_SOUND_LONG` | +| `SOUND_BACK` | unset | sound for going back to work, falls back to `SYS_SOUND_BACK` | + +Check what is in effect: + +```bash +breaktimer.sh config +``` + +The file is read when the daemon starts, so a change takes effect on +`breaktimer.sh restart`. A syntax error in it is a bash error at start, +reported on stderr. + +The check for all of this is `./test-breaktimer-config.sh`. ## Waybar integration |
