Tomat
Tomat ("tomato" in Swedish 🇸🇪) is 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
- 🔊 Sound Notifications: Audio alerts enabled by default with embedded sounds and customization
- 💾 Minimal Resources: Lightweight and efficient
Quick Start
# Install from crates.io
# Start daemon and begin working
# Check status (perfect for waybar)
# Optional: Configure defaults in ~/.config/tomat/config.toml
Installation
Prerequisites
On Linux systems, audio notifications require ALSA development libraries:
# Ubuntu/Debian
# Fedora/RHEL
# Arch Linux
Note: Audio will be automatically disabled if ALSA is not available. The timer will still work normally with desktop notifications only.
Quick Install (Recommended)
# Install from crates.io
# Set up systemd service for auto-start
Note: Ensure ~/.cargo/bin is in your PATH.
Install from Source
# Clone and install
This installs the binary and sets up the systemd service automatically.
Manual Installation
# Install from crates.io or build from source
# OR
# 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.
Sound Notifications
By default, tomat plays audio notifications when transitioning between work/break phases:
- Embedded sounds: High-quality WAV files built into the application
- Linux requirement: Requires ALSA (Advanced Linux Sound Architecture)
- Automatic fallback: If audio system unavailable, falls back to system beep or disables audio
- Customizable: Override with your own sound files or disable entirely
- Volume control: Adjustable volume level (0.0 to 1.0)
To disable audio notifications:
[]
= false
To use custom sound files:
[]
= "/path/to/your/work-end-sound.wav"
= "/path/to/your/break-end-sound.wav"
= "/path/to/your/long-break-start.wav"
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)
[]
= true # Enable sound notifications (default: true)
= false # Use system beep instead of WAV files (default: false)
= true # Use embedded sounds (default: true)
= 0.5 # Volume level 0.0-1.0 (default: 0.5)
# Custom sound files (optional - override embedded sounds)
# work_to_break = "/path/to/work-to-break.wav"
# break_to_work = "/path/to/break-to-work.wav"
# work_to_long_break = "/path/to/work-to-long-break.wav"
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 start
Partial Configuration
You can specify only the values you want to override:
[]
= 30.0
= true
# Other values will use built-in defaults
[]
= false # Disable all sound notifications
# Other sound settings 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.