tomat
A Pomodoro timer with daemon support designed for waybar and other status bars.
Features
- 🍅 Pomodoro Technique: Work/break cycles with configurable durations
- ⚙️ TOML Configuration: Persistent defaults via XDG config directory
- ⚡ Daemon Architecture: Robust background service that survives restarts
- 📊 Waybar Integration: JSON output with CSS classes for seamless integration
- 🎮 Visual Indicators: Play ▶ and pause ⏸ symbols for clear state indication
- 🔧 Auto-advance Control: Choose between manual or automatic phase transitions
- 🔄 Process Management: Built-in daemon start/stop/status commands
- 🖥️ Unix Sockets: Fast, secure local communication
- 🌙 Systemd Integration: Auto-start with user session
- 📱 Desktop Notifications: Phase transition alerts
- 💾 Minimal Resources: Lightweight and efficient
Quick Start
# Install
&&
# Start daemon and begin working
# Check status (perfect for waybar)
# Optional: Configure defaults in ~/.config/tomat/config.toml
Installation
Quick Install (Recommended)
This installs the binary and sets up the systemd service automatically.
Manual Installation
# Build and install
# Set up systemd service
Note: Ensure ~/.cargo/bin is in your PATH.
Configuration
Tomat can be configured using a TOML file located at
~/.config/tomat/config.toml. This allows you to set default values for timer
durations and behaviors without specifying them on every command.
Example Configuration
Create ~/.config/tomat/config.toml:
[]
= 25.0 # Work duration in minutes (default: 25)
= 5.0 # Break duration in minutes (default: 5)
= 15.0 # Long break duration in minutes (default: 15)
= 4 # Sessions until long break (default: 4)
= false # Auto-advance between phases (default: false)
Priority Order
Settings are applied in this order (later overrides earlier):
- Built-in defaults: 25min work, 5min break, 15min long break, 4 sessions
- Config file: Values from
~/.config/tomat/config.toml - CLI arguments: Flags passed to
tomat startortomat toggle
Partial Configuration
You can specify only the values you want to override:
[]
= 30.0
= true
# Other values will use built-in defaults
Usage
Daemon Management
# Start daemon in background
# Check daemon status
# Stop daemon
Timer Control
# Start Pomodoro (25min work, 5min break by default)
# Start with custom durations and auto-advance
# Toggle pause/resume
# Skip to next phase
# Stop current session
# Get status (JSON for waybar)
Auto-advance Behavior
By default (--auto-advance=false):
- Timer transitions to next phase but pauses
- You manually resume with
tomat toggleortomat start - Gives you control over when breaks start/end
With --auto-advance=true:
- Timer automatically continues through all phases
- No manual intervention needed
- Traditional Pomodoro timer behavior
Waybar Integration
Configuration
Add to your waybar config:
"custom/pomodoro":
Styling
The status output provides CSS classes for styling:
}
}
}
}
}
}
Output Format
The tomat status command returns JSON optimized for status bars:
Visual Indicators
- Icons: 🍅 (work), ☕ (break), 🏖️ (long break)
- State: ▶ (running), ⏸ (paused)
- Format:
{icon} {time} {state}
CSS Classes
work/work-paused- Work session running/pausedbreak/break-paused- Break session running/pausedlong-break/long-break-paused- Long break running/paused
Architecture
┌─────────────────┐ Unix Socket ┌──────────────────┐
│ tomat start │ ──────────────────▶│ tomat daemon │
│ tomat status │ │ │
│ tomat toggle │ ◀──────────────────│ Timer State │
│ tomat stop │ JSON Response │ Notifications │
└─────────────────┘ └──────────────────┘
(Client) (Background)
- Daemon: Runs continuously, manages timer state and notifications
- Client: Sends commands via Unix socket (
$XDG_RUNTIME_DIR/tomat.sock) - Persistence: Timer survives waybar restarts and system suspend/resume
Examples
Basic Workflow
# Start daemon
# Begin a Pomodoro session
# Status shows: 🍅 24:30 ▶
# Pause for interruption
# Status shows: 🍅 24:30 ⏸
# Resume work
# Status shows: 🍅 24:29 ▶
# When work completes (auto_advance=false default)
# Status shows: ☕ 05:00 ⏸
# Start break manually
# Status shows: ☕ 04:59 ▶
Automatic Mode
# Start with auto-advance (no manual resume needed)
# Timer automatically flows: Work ▶ → Break ▶ → Work ▶ → ...
# No manual intervention required
Development
See CONTRIBUTING.md for detailed development documentation.
# Quick development workflow
License
MIT License - see the LICENSE file.
Contributing
- Fork the repository
- Create a feature branch
- Make changes with tests
- Run
cargo testandcargo clippy - Submit a pull request
Bug reports and feature requests welcome via GitHub Issues.