- Features
- Windows MSI Installer
- Usage Examples
- How to Build
- Audio Files
- Dependencies
- Music Credits
- Additional Tests
- Custom duration input (e.g.
1h 30m 45s) - Optional message/reminder after timer ends (e.g.
--message "Wash car") - Embedded audio files for portability
- Randomized music playback after the timer ends
- Graceful
Ctrl+Chandling - Stylish progress bar using
indicatif
You can now install Terminal Timer easily on Windows using the MSI installer. If you already have it installed, uninstall the old one first.
- Download the latest
terminal_timer_windows.msifrom the Releases page. - Double-click the
.msifile and follow the installation wizard. - The installer will add the Terminal Timer install directory to your user PATH environment variable.
Once installed, open a new Command Prompt or PowerShell window and simply run:
terminal_timer.exe 90s -m "Take a break!"or just
terminal_timer 90sterminal_timer 1h --message "Wash car"
terminal_timer 20m -m "Take a break!"terminal_timer 90s
terminal_timer 2m
terminal_timer 1h 10sterminal_timer
# Enter duration (e.g. 1h 20m 30s): 10m
# Enter message (optional, press Enter to skip): Make teaterminal_timer 1h 10s -m "Check laundry"terminal_timer.exe 2m --message "Stretch!"-
Clone the repository:
git clone https://github.com/Arman511/terminal_timer.git cd terminal_timer
-
Build the project:
cargo build --release -
The optimized binary will be at
target/release/terminal_timer(Linux/macOS) ortarget/release/terminal_timer.exe(Windows).
cargo run 1h 15m 30s --message "Start dinner"Or omit the duration and input it interactively:
cargo run
# Enter duration (e.g. 2m 10s)
# Enter message (optional, press Enter to skip):./target/release/terminal_timer 45s -m "Feed the cat".\target\release\terminal_timer.exe 45s --message "Feed the cat"If you want to run terminal_timer from anywhere, add the binary directory to your system PATH:
On Linux/macOS:
echo 'export PATH="$PATH:/path/to/terminal_timer"' >> ~/.bashrc
source ~/.bashrcOn Windows (PowerShell):
$env:Path += ";\path\to\terminal_timer"
# To make it permanent, add the path to your user environment variables.After this, you can simply run:
terminal_timer 45s -m "Do pushups"or
terminal_timer.exe 45s --message "Do pushups"Audio files must be stored in the audio/ directory and will be embedded at compile-time using include_bytes!.
audio/
├── 1.ogg
├── 2.ogg
├── 3.ogg
└── 4.ogg
You can replace these with any audio files you like or add more—just make sure to update the code if you add more.
- clap – Command-line parsing
- ctrlc – Ctrl+C signal handling
- indicatif – Progress bars
- rand – Random number generation
- rodio – Audio playback
- regex – Input parsing
Install them automatically with cargo build.
The timer music used in this project is sourced from Pixabay.
- Music by Lesiakower from Pixabay
- Music by dferun from Pixabay
- Music by Ellis Checkley from Pixabay
-
parse_duration:- Handles valid inputs with hours, minutes, and seconds.
- Handles plain numeric inputs as seconds.
- Handles large values for hours, minutes, and seconds.
-
format_duration:- Formats durations with hours, minutes, and seconds.
- Handles zero duration.
- Handles large durations.
-
Start a timer for 1 hour, 20 minutes, and 30 seconds:
cargo run "1h 20m 30s" -
Start a timer for 45 seconds with a custom message:
cargo run "45" --message "Break time!"
-
Interactive mode:
cargo run
Enter the duration and message when prompted.