Creates a timer that is detached from the shell so it can run in the background. The daemonization of the process makes it easy to integrate it into external programs such as status-bars. If configured, it can execute a program/script when the timer completes.
This is not cross-platform, only works on Linux since it depends on the fork
function from libc
to daemonize
the timer.
cargo install --path .
Start timer, defaults to 25 minutes if no duration flag is supplied.
timer start
Start timer for 10 minutes using the -d
flag.
timer start -d 10
Start timer that executes a program or script when the timer completes.
timer start -d 10 -f /home/my_user/finished.sh
Example of a bash script that shows a notification and plays a sound when the timer completes.
finished.sh
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
dunstify "Timer finished."
ffplay -volume 50 -nodisp -autoexit ~/.config/timer-cli/break_sound.mp3
Timer status writes the remaining time before the timer completes, an example is 09:52
.
timer status
Cancels the timer, if it is running.
timer cancel