Tomat
Tomat ("tomato" in Swedish 🇸🇪) is a Pomodoro timer for Linux, designed for seamless integration with 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 with configurable icons
- 🖼️ Icon System: Embedded icon with mako compatibility and custom icon support
- 🔊 Sound Notifications: Audio alerts 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)
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"
💡 Tip: Copy the complete example config:
# Edit as needed
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)
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.
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
Contributing
Contributions are welcome! See CONTRIBUTING.md for details.