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
Unless Tomat is available in your package manager (currently only on NixOS), the easiest way to get started is via Cargo. Unless you have Rust and Cargo installed, follow the instructions at https://www.rust-lang.org/tools/install.
# Install from crates.io
# Start daemon and begin working
# Check status
Documentation
The full documentation is available at https://jolars.github.io/tomat/.
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
NixOS
If you are using NixOS, tomat is available in the official packages:
{
environment.systemPackages = [
pkgs.tomat
];
}
You still need to set up the systemd service for automatic startup. But if you're using home manager, you're in luck! Tomat is supported as a module:
{
services.tomat = {
enable = true;
settings = {
timer = {
work = 25;
break = 5;
};
};
};
}
Quick Setup with Systemd
After installing tomat, you can set up the systemd service with a single command:
# 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 through all phases
# Auto-advance only from work to break (forced breaks)
# Auto-advance only from break to work (self-paced work)
Control Timer
The timer is controlled through several tomat subcommands:
Daemon Management
The server (daemon) can be managed with tomat daemon <subcommand>:
Uninstall
To completely remove tomat, follow these steps:
# Stop and remove systemd service
# Remove the binary
# Remove configuration (optional)
Configuration
Tomat follows XDG Base Directory standards. Create $XDG_CONFIG_HOME/tomat/config.toml (typically ~/.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
= "none" # Auto-advance mode: "none", "all", "to-break", "to-work"
[]
= "embedded" # Sound mode: "embedded", "system-beep", "none"
= 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:
# Phase transitions:
# on_work_start, on_work_end
# on_break_start, on_break_end
# on_long_break_start, on_long_break_end
# Timer control:
# on_pause, on_resume, on_stop, on_skip
#
# 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 - Auto-advance mode ("none", "all", "to-break", "to-work")
# 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
Waybar Integration
Add this to your waybar config (~/.config/waybar/config):
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:
Output 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.
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 with automatic progression
# Enforced breaks (auto-advance only to break)
# Self-paced work (auto-advance only to work)
# 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
$XDG_CONFIG_HOME/tomat/config.toml (or built-in defaults if no config exists).
Contributing
Contributions are welcome! See CONTRIBUTING.md for details.