Tomat ("tomato" in Swedish πΈπͺ) is a Pomodoro timer for Linux, designed for seamless integration with waybar and other status bars.
- βοΈ Easily Configurable: Persistent defaults via TOML configuration
- β‘ Architecture: Client-server architecture that survives service restarts
- π Flexible Ouput: Multiple output formats to support waybar, polybar, and others
- π± Notifications: Built-in desktop and sound notifications
# Install from crates.io
cargo install tomat
# Start daemon and begin working
tomat daemon start
tomat start
# Check status (perfect for waybar)
tomat statusOn Linux systems, audio notifications require ALSA development libraries:
# Ubuntu/Debian
sudo apt-get install libasound2-dev
# Fedora/RHEL
sudo dnf install alsa-lib-devel
# Arch Linux
sudo pacman -S alsa-libNote: Audio will be automatically disabled if ALSA is not available. The timer will still work normally with desktop notifications only.
cargo install tomatAfter installing tomat, you can set up the systemd service with a single command:
# Install systemd user service (recommended)
tomat daemon install
# Start the daemon
systemctl --user start tomat.serviceAlternative manual setup:
# Manual systemd setup (if you prefer)
mkdir -p ~/.config/systemd/user
curl -o ~/.config/systemd/user/tomat.service https://raw.githubusercontent.com/jolars/tomat/main/examples/systemd.service
systemctl --user daemon-reload
systemctl --user enable tomat.service
systemctl --user start tomat.service# Start with defaults (25min work, 5min break)
tomat start
# Custom durations
tomat start --work 30 --break 10 --long-break 20 --sessions 3
# Auto-advance between phases
tomat start --auto-advancetomat status # Get current status (JSON for waybar)
tomat watch # Continuously output status updates
tomat toggle # Pause/resume timer
tomat skip # Skip to next phase
tomat stop # Stop timer and return to idletomat daemon start # Start background daemon
tomat daemon stop # Stop daemon
tomat daemon status # Check daemon status
tomat daemon install # Install systemd user service
tomat daemon uninstall # Remove systemd user serviceTo completely remove tomat:
# Stop and remove systemd service
tomat daemon uninstall
# Remove the binary
cargo uninstall tomat
# Remove configuration (optional)
rm -rf ~/.config/tomatCreate ~/.config/tomat/config.toml to customize defaults:
[timer]
work = 25.0 # Work duration in minutes
break = 5.0 # Break duration in minutes
long_break = 15.0 # Long break duration in minutes
sessions = 4 # Sessions until long break
auto_advance = false # Auto-continue to next phase
[sound]
enabled = true # Enable sound notifications
volume = 0.5 # Volume level (0.0-1.0)
[notification]
enabled = true # Enable desktop notifications
icon = "auto" # Icon mode: "auto", "theme", or custom path
timeout = 4000 # Notification timeout in milliseconds
[display]
text_format = "{icon} {time} {state}" # Text display format
# Available placeholders: {icon}, {time}, {state}, {phase}, {session}
# Examples:
# "{time}" -> "25:00"
# "{phase}: {time} {state}" -> "Work: 25:00 βΆ"
# "[{session}] {icon} {time}" -> "[1/4] π
25:00"π‘ Tip: Copy the complete example config:
mkdir -p ~/.config/tomat
cp examples/config.toml ~/.config/tomat/config.toml
# Edit as neededAdd to your waybar config (~/.config/waybar/config):
{
"modules-right": ["custom/tomat"],
"custom/tomat": {
"exec": "tomat status",
"interval": 1,
"return-type": "json",
"format": "{}",
"on-click": "tomat toggle",
"on-click-right": "tomat skip"
}
}For reduced CPU usage, use the watch command instead:
{
"modules-right": ["custom/tomat"],
"custom/tomat": {
"exec": "tomat watch --interval 1",
"return-type": "json",
"format": "{}",
"on-click": "tomat toggle",
"on-click-right": "tomat skip"
}
}Note: The watch command maintains a single connection to the daemon and
updates at the specified interval (default: 1 second). It automatically exits
when the daemon stops.
Add CSS styling (~/.config/waybar/style.css):
#custom-tomat.work {
background-color: #ff6b6b;
}
#custom-tomat.work-paused {
background-color: #ff9999;
}
#custom-tomat.break {
background-color: #4ecdc4;
}
#custom-tomat.break-paused {
background-color: #7dd3db;
}
#custom-tomat.long-break {
background-color: #45b7d1;
}
#custom-tomat.long-break-paused {
background-color: #74c0db;
}π‘ Tip: See examples/ for configuration examples for waybar
and other status bars.
By default, Tomat provides waybar-optimized JSON output:
{
"text": "π
24:30 βΆ",
"tooltip": "Work (1/4) - 25.0min",
"class": "work",
"percentage": 2.0
}Outupt can be styled by using the css classes work, work-paused, break,
break-paused, long-break, and long-break-paused.
The output type can be changed via the -o (--output) flag, with options
waybar (default), i3status-rs, and plain.
For detailed guides and advanced configuration:
- π Documentation Index - Complete documentation overview
- π Examples - Ready-to-use configurations (waybar, systemd, etc.)
- π Configuration Guide - Complete configuration options
- π Integration Guide - Waybar, systemd, and notification setup
- π Troubleshooting - Common issues and solutions
# One-time setup
cargo install tomat
# Daily usage
tomat daemon start
tomat start # Begin 25min work session
# ... work on your task ...
tomat status # Check remaining time
tomat toggle # Take a quick pause
tomat skip # Move to break early
# ... enjoy your break ...
# Timer automatically suggests when to return to work# Long focus session
tomat start --work 45 --break 15
# Sprint session
tomat start --work 15 --break 5 --auto-advance
# Deep work (no interruptions)
tomat start --work 90 --break 30 --sessions 2Tomat uses a client-daemon architecture with Unix socket communication to allow fast and reliable interactions, with persistent timer state managed by the daemon.
Client Commands β Unix Socket β Daemon β Timer State β Output
β β β β β
tomat start $XDG_RUNTIME_DIR/ Background Work/Break/ {"text": "π
25:00 βΆ",
tomat status tomat.sock Service LongBreak "class": "work"}
tomat toggle Phases
- Daemon: Runs continuously, manages timer state and notifications
- Client: Sends commands via Unix socket
- Persistence: Timer survives waybar restarts and system suspend/resume
- Notifications: Desktop alerts and optional sound notifications on phase transitions
Contributions are welcome! See CONTRIBUTING.md for details.