Tomat
Tomat ("tomato" in Swedish πΈπͺ) is a Pomodoro timer for Linux, designed for seamless integration with waybar and other status bars.
Features
- βοΈ 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
Quick Start
# Install from crates.io
# Start daemon and begin working
# Check status (perfect for waybar)
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.
Install from Crates.io
Quick Setup with Systemd
After installing tomat, you can set up the systemd service with a single command:
# Install systemd user service (recommended)
# Start the daemon
Alternative manual setup:
# Manual systemd setup (if you prefer)
Basic Usage
Start Timer
# Start with defaults (25min work, 5min break)
# Custom durations
# Auto-advance between phases
Control Timer
Daemon Management
Uninstall
To completely remove tomat:
# Stop and remove systemd service
# Remove the binary
# Remove configuration (optional)
Configuration
Create ~/.config/tomat/config.toml to customize defaults:
[]
= 25.0 # Work duration in minutes
= 5.0 # Break duration in minutes
= 15.0 # Long break duration in minutes
= 4 # Sessions until long break
= false # Auto-continue to next phase
[]
= true # Enable sound notifications
= 0.5 # Volume level (0.0-1.0)
[]
= true # Enable desktop notifications
= "auto" # Icon mode: "auto", "theme", or custom path
= 4000 # Notification timeout in milliseconds
[]
= "{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"
[]
# Execute custom commands on timer events (optional)
# All hooks support these fields:
# cmd (required): Command to execute (absolute path recommended)
# args (optional): Array of arguments, default []
# timeout (optional): Timeout in seconds, default 5
# cwd (optional): Working directory, default $HOME
# capture_output (optional): Capture stdout/stderr for debugging, default false
#
# Available hooks: on_work_start, on_break_start, on_long_break_start,
# on_pause, on_resume, on_stop, on_complete, on_skip
#
# SECURITY: Hooks execute with daemon's user privileges. Only configure
# trusted commands. Commands are executed directly (no shell), preventing
# injection attacks.
#
# Environment variables passed to hooks:
# TOMAT_EVENT - Event name (e.g., "work_start", "pause")
# TOMAT_PHASE - Current phase ("work", "break", "long_break")
# TOMAT_REMAINING_SECONDS - Seconds remaining in current phase
# TOMAT_SESSION_COUNT - Current session number
# TOMAT_AUTO_ADVANCE - Whether auto-advance is enabled ("true"/"false")
# Example hooks:
# [hooks.on_work_start]
# cmd = "notify-send"
# args = ["π
Work Time", "Focus for 25 minutes"]
#
# [hooks.on_break_start]
# cmd = "playerctl"
# args = ["pause"]
# timeout = 2
#
# [hooks.on_pause]
# cmd = "/home/user/scripts/dim-screen.sh"
# cwd = "/home/user"
π‘ Tip: Copy the complete example config:
# Edit as needed
Security Notes
Hooks execute with daemon's user privileges. Follow these guidelines:
- β
Config file ownership: Ensure
~/.config/tomat/config.tomlis owned by your user - β
Never run as root: Always use
--usersystemd service or run daemon as regular user - β No shell injection: Hook commands are executed directly (not via shell), preventing injection attacks
- β οΈ Validate commands: Only configure hooks with trusted executables
- β οΈ Path safety: If using
cwd, ensure the directory exists and is safe
Threat model: If an attacker controls your ~/.config directory, they
already have code execution (via shell rc files, etc.). Hooks don't introduce
new attack vectors beyond standard Unix permissions.
Waybar Integration
Add to your waybar config (~/.config/waybar/config):
Option 1: Polling with status (recommended for most users)
Option 2: Continuous updates with watch
For reduced CPU usage, use the watch command instead:
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):
}
}
}
}
}
}
π‘ Tip: See examples/ for configuration examples for waybar
and other status bars.
Output
By default, Tomat provides waybar-optimized JSON output:
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.
Documentation
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
Examples
Basic Workflow
# One-time setup
# Daily usage
# ... work on your task ...
# ... enjoy your break ...
# Timer automatically suggests when to return to work
Custom Sessions
# Long focus session
# Sprint session
# Deep work (no interruptions)
# Return to configured defaults - just run start without flags
Note: Custom durations only apply to the current session. Running
tomat start without flags will always use your configured defaults from
~/.config/tomat/config.toml (or built-in defaults if no config exists).
Architecture
Tomat uses a client-daemon architecture with Unix socket communication to allow fast and reliable interactions, with persistent timer state managed by the daemon.

- 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
Contributing
Contributions are welcome! See CONTRIBUTING.md for details.