A flexible workout/pomodoro timer CLI application written in Rust.
- Work and break intervals with customizable durations
- Cycle limiting - run a specific number of cycles or infinitely
- Flexible time formats - specify durations in seconds, minutes, or hours
- Countdown before starting the timer
- Custom sound support - use your own audio files (.wav/.mp3) for notifications
- Terminal UI with large 7-segment style timer display
- Keyboard controls - pause, skip, and quit
- Audio notifications - different sounds for work end, break end, and completion
cargo build --releaseThe binary will be located at ./target/release/oxitimer.
# Positional arguments: WORK BREAK [CYCLES]
oxitimer 25 5 # 25 sec work, 5 sec break, infinite cycles
oxitimer 25 5 3 # 25 sec work, 5 sec break, 3 cycles# Using named options
oxitimer --work 25 --break 5 --cycles 3
oxitimer -w 25 -b 5 -c 3By default, durations are in seconds. Use --time-format or -t to change:
# Minutes
oxitimer -w 25 -b 5 -t min # 25 minutes work, 5 minutes break
# Hours
oxitimer -w 1 -b 0.25 -t hour # 1 hour work, 15 minutes break
# Seconds (default)
oxitimer -w 1500 -b 300 -t sec # 1500 seconds work, 300 seconds breakSupported format values: sec, second, seconds, s, min, minute, minutes, m, hour, hours, h
Customize the countdown before the timer starts:
# Custom countdown (always in seconds)
oxitimer 25 5 -C 10 # 10 second countdown
# Default countdown is 5 seconds
oxitimer 25 5 # 5 second countdown
# No countdown
oxitimer 25 5 -C 0 # Start immediatelyDuring the timer:
- Space - Pause/Resume
- Enter - Skip to next session (plays beep sound)
- Q - Quit
oxitimer initThis creates the following directory structure:
~/.config/oxitimer/sounds/
├── work_end/ # Sound when work session ends
├── break_end/ # Sound when break session ends
├── at_finish/ # Sound when all cycles complete
└── countdown/ # Sound at countdown start
- Place
.wavor.mp3files in the appropriate directories - Only one sound file per directory is used (first found)
- If no custom sound is found, a default beep will play
- Work/Break completion (natural timer end): Plays WorkEnd/BreakEnd sound
- Manual skip (Enter key): Plays beep sound only
- Final cycle completion: Plays Finish sound only (no WorkEnd sound to avoid overlap)
- Countdown: Plays countdown sound at start, then beeps at 3-2-1 seconds
All sounds are preloaded at startup for instant playback with no delay.
oxitimer -w 25 -b 5 -c 4 -t minoxitimer 30 10 10oxitimer -w 50 -b 10 -c 3 -t min -C 0oxitimer -w 1 -b 0.25 -t hourThe terminal UI shows:
- Session type - Work or Break (with color coding)
- Timer - Large 7-segment style display (MM:SS)
- Status - Running, Paused, or Completed
- Cycle counter - Current cycle / Total cycles (e.g., "Cycle: 2/4")
- Controls - Keyboard shortcuts
- Cycles start at 1 (not 0) for intuitive display
- A cycle consists of: Work session → Break session
- The final break is skipped - the timer finishes immediately after the last work session
- Example with 2 cycles:
Cycle 1: Work → Break → Cycle 2: Work → Finished (no break)
The project follows a layered architecture:
-
Domain Layer (
src/domain/) - Core business logic- Session state management
- Timer logic
- Session types (Work/Break)
-
Infrastructure Layer (
src/infrastructure/) - External interfaces- Terminal UI rendering
- Audio playback with rodio
- 7-segment digit display
-
Application Layer (
src/main.rs) - Application entry point- CLI argument parsing
- Main event loop
- Keyboard input handling
clap- Command-line argument parsingcrossterm- Terminal manipulationtokio- Async runtimerodio- Audio playbackanyhow- Error handling
This project is licensed under the MIT License - see the LICENSE file for details.