A minimalist command-line timer with smart time parsing and system integration
Project description
Minimal Timer
A minimalist command-line timer with smart time parsing and system integration.
✨ Features
- 🕐 Smart time parsing - Natural language input:
10m,1h 30s,2d 5h - 📝 Optional labels - Name your timers with
-nflag - 💤 Sleep integration - Auto-sleep system (
-s) or display (-sd) when done - 🚀 Execute command - Run any command when timer finishes (
-e "say done") - 📋 Multiple timers - Run multiple timers and list them with
-ls - ⚡ Minimal output - Clean, distraction-free countdown
- 🔔 Audio notification - Bell sound on completion
- 🌍 Universal - Works in bash, zsh, fish, and other shells
- 🔍 Spotlight support - Launch from macOS Spotlight
📦 Installation
🐍 PyPI (Universal)
pip install minimal-timer
🍺 Homebrew (macOS)
brew install dandaniel5/timer/timer
📸 Snap Store (Linux)
snap install minimal-timer
🪟 Winget (Windows)
winget install DanilKodolov.MinimalTimer
Manual Installation
git clone https://github.com/dandaniel5/minimal-timer.git
cd minimal-timer
chmod +x timer
cp timer /usr/local/bin/
macOS Spotlight Integration
After installation, you can also launch Timer from Spotlight:
- Press
Cmd + Space - Type "Timer"
- Press Enter
🚀 Usage
Basic Examples
# Simple timer (defaults to minutes)
timer 5
# Output: 4m 59s
# With time units
timer 10m
timer 1h 30m
timer 2d 5h 30m
# With a label
timer 25m -n "Pomodoro"
# Output: Pomodoro 24m 59s
# Sleep system after timer
timer 1h -s
# Sleep display only after timer
timer 30m -sd
# Execute command after timer
timer 5m -e "say 'Timer finished'"
timer 10m -e "open https://google.com"
# List all running timers
timer -ls
Advanced Usage
# Run multiple timers in background
timer 1h -n "Meeting" &
timer 25m -n "Pomodoro" &
timer 10m -n "Break" &
# Check running timers
timer -ls
# Output:
# Running timers:
# Meeting 59m 30s
# Pomodoro 24m 15s
# Break 9m 45s
# Complex duration with sleep
timer 1w 2d 3h -n "Vacation countdown" -sd
Supported Time Units
| Unit | Aliases | Example |
|---|---|---|
| Seconds | s, sec, second, seconds |
30s |
| Minutes | m, min, minute, minutes |
10m (default) |
| Hours | h, hour, hours |
2h |
| Days | d, day, days |
3d |
| Weeks | w, week, weeks |
1w |
| Years | y, year, years |
1y |
Command-Line Options
usage: timer [-h] [-n NAME] [-s] [-sd] [-ls] [time_input ...]
positional arguments:
time_input Time to count down (e.g. '10m', '1h 30s', '5')
optional arguments:
-h, --help Show help message
-n NAME, --name NAME Timer name/label
-s, --sleep Sleep system after timer completes
-sd, --sleep-display Sleep display only after timer completes
-e EXECUTE, --execute EXECUTE
Command to execute after timer
-ls, --list List all running timers
-v, --version Show version info
🎯 Use Cases
Pomodoro Technique
timer 25m -n "Work" && timer 5m -n "Break"
Meeting Reminder
timer 1h -n "Team Meeting" -s
Screen Break
timer 20m -n "Eye Rest" -sd
Cooking
timer 12m -n "Pasta" &
timer 15m -n "Sauce" &
timer -ls
🛠️ Requirements
- Python 3.6+
- macOS (for sleep functionality)
📝 How It Works
- Parsing: The timer uses regex to parse natural language time input, supporting multiple units in a single command
- Countdown: Updates every 100ms for smooth display, showing only non-zero time units
- Tracking: Saves timer info to temp directory (
/tmp/smart_timers/) for multi-timer support - Sleep Integration: Uses macOS
pmsetcommands to trigger system or display sleep - Cleanup: Automatically removes timer info on completion or cancellation
🤝 Contributing
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
📄 License
GPL v3 License - see LICENSE file for details.
👤 Author
Created by Danil Kodolov
Tip: Add alias t='timer' to your shell config for even faster access! 🚀
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minimal_timer-1.0.4.tar.gz.
File metadata
- Download URL: minimal_timer-1.0.4.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b2a649bff886266225740cb2ba3154b8819f92023da3a02c5d2574c96f0e141
|
|
| MD5 |
81a482faa35b464c1bc35389634527f5
|
|
| BLAKE2b-256 |
6c103dcc6c8ea27be6f5e0c394bc4de83b1329e72deaaa9a12950a08f6629caf
|
File details
Details for the file minimal_timer-1.0.4-py3-none-any.whl.
File metadata
- Download URL: minimal_timer-1.0.4-py3-none-any.whl
- Upload date:
- Size: 7.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6144f993df15ce89104e6cdd792f5fdf0e4e8f407782426df7f9af3219e9f4d3
|
|
| MD5 |
28017343e662929d9027d553b5efcbc0
|
|
| BLAKE2b-256 |
655535d11cc25f713bbfb3ec93cf3aa8ca8e6b8f6d7c169dedb89ad60a960314
|