Crates.io | pomodoro-cli |
lib.rs | pomodoro-cli |
version | 1.2.5 |
source | src |
created_at | 2024-01-15 14:55:27.697082 |
updated_at | 2024-03-26 18:30:59.25127 |
description | A simple command line Pomodoro timer. |
homepage | https://github.com/jkallio/pomodoro-cli |
repository | https://github.com/jkallio/pomodoro-cli |
max_upload_size | |
id | 1100399 |
size | 432,059 |
Pomodoro timer is a simple timer that helps you to stay focused on your tasks.
pomodoro-cli
is a CLI application which implements the basic functionalities of a basic Pomodoro timer. This application was designed to be used with waybar.
$ cargo install pomodoro-cli
Options for start
:
--duration
Set the duration for the timer (format: 1h 30m 15s
or 10:30
)--add
Add more time to a running timer instead of starting a new timer--message
Add a custom message to the timer status--resume
Resume a paused timer (default: disabled)--notify
Triggers system notification when the timer is finished (default: disabled)--silent
Do not play alarm sound when the timer is finished (default: enabled)--wait
Wait for the timer to finish (default: disabled)--lock-screen
Wait for the timer to finish and lock the screen once the timer is finished (default: disabled)# Start the timer with default configuration (25 min with alarm sound)
$ pomodoro-cli start
# Start a 30 min timer wihout playing alarm sound, but triggering a system notification
$ pomodoro-cli start --duration "30m" --silent --notify
# Stop the timer
$ pomodoro-cli stop
# Pause the Timer (calling this command again will resume the timer)
$ pomodoro-cli pause
# Resume a paused timer
$ pomodoro-cli start --resume
# Add 10 minutes to the timer (instead of starting a new timer)
$ pomodoro-cli start -add 10m
## Get remaining time in human readable format
$ pomodoro-cli status --format human
# Get the timer status in JSON format (for Waybar integration)
$ pomodoro-cli status --format json
# Specify the timer format in digital format (10:30) -- default
$ pomodoro-cli status --format human --time-format digital
# Specify the time format in segmented format (1h 30m 15s)
$ pomodoro-cli status --format human --time-format segmented
# Specify the time format in seconds
$ pomodoro-cli status --format human --time-format seconds
Add the following module to your waybar configuration:
"custom/pomo": {
"format": " {}",
"exec": "pomodoro-cli status --format json --time-format digital",
"return-type": "json",
"on-click": "pomodoro-cli start --add 5m --notify",
"on-click-middle": "pomodoro-cli pause",
"on-click-right": "pomodoro-cli stop",
"interval": 1
},
The module supports three different states: running
, paused
and finished
. You can customize the styling of each state by adding the following CSS rules to your Waybar configuration:
#custom-pomo.running {
background: #304D30;
}
#custom-pomo.paused {
background: #AB730A;
}
#custom-pomo.finished {
background: #8F0808;
}
If you want to signal Waybar to update the module immediately when you can add pkill -SIGRTMIN+10 waybar
to the on-click
commands. For example:
"custom/pomo": {
"on-click": "pomodoro-cli start --add 5m; pkill -SIGRTMIN+10 waybar",
"signal": 10,
}
If you want to use a custom alarm sound, just add a alarm.mp3
file in the ~/.config/pomodoro-cli
directory.
$ mkdir -p ~/.config/pomodoro-cli
$ cp /path/to/alarm.mp3 ~/.config/pomodoro-cli/alarm.mp3
If you want to use a custom notification icon, just add a icon.png
file in the ~/.config/pomodoro-cli
directory.
$ mkdir -p ~/.config/pomodoro-cli
$ cp /path/to/icon.png ~/.config/pomodoro-cli/icon.png