LinuxCommandLibrary

termdown

Shutdown a Linux computer after a delay

TLDR

Start a stopwatch

$ termdown
copy

Start a 1 minute and 30 seconds countdown
$ termdown [1m30s]
copy

Start a 1 minute 30 seconds countdown with blinking the terminal at the end
$ termdown [1m30s] --blink
copy

Show a title above countdown
$ termdown [1m30s] --title "[Interesting title]"
copy

Display current time
$ termdown --time
copy

SYNOPSIS

termdown [OPTIONS] [TIME]
Example: termdown 5m or termdown -c 'notify-send "Time up!"' 1h30m

PARAMETERS

--alert, -a
    Plays an audible alert sound when the timer finishes. Requires a sound player (e.g., play from SoX) to be available on the system.

--command , -c
    Executes the specified shell command CMD immediately after the countdown finishes.

--duration
    Specifies the countdown duration. This is an alternative to providing TIME as a positional argument.

--fullscreen, -f
    Displays the countdown in a large, centered font for better visibility, especially during presentations.

--help, -h
    Shows the command's help message and exits.

--list-sounds, -l
    Lists available alert sound themes that can be used with the --alert option.

--message , -m
    Displays a custom text message MSG after the countdown completes, in addition to the default "Time is up!".

--progress, -p
    Shows a visual progress bar during the countdown, indicating the elapsed time relative to the total duration.

--repeat , -r
    Repeats the countdown N times. If N is 0 or omitted, it repeats indefinitely.

--silent, -s
    Suppresses all visual output during the countdown, only performing the final action (command or alert).

--version, -v
    Displays the version information of termdown and exits.

DESCRIPTION

termdown is a minimalist, yet powerful, command-line utility designed to provide a visual countdown timer directly in your terminal. It supports various time formats (e.g., seconds, minutes, hours) and can be configured to display progress, play alert sounds, or execute a specified command upon completion. Its simplicity makes it ideal for productivity techniques like Pomodoro, presentations, or general time management in a console environment. It's highly scriptable, allowing integration into automated workflows or custom shell scripts.

CAVEATS

Audible alerts (--alert) require a system sound player like play from the `sox` package to be installed and configured.
Fullscreen mode behavior (--fullscreen) may vary slightly depending on the terminal emulator used.
termdown is primarily designed for interactive use; complex background scripting might require careful handling of its output.

FLEXIBLE TIME FORMATS

termdown accepts various time specifications, including just seconds (e.g., 600 for 10 minutes), combined units (e.g., 1h30m, 5m30s), or single units (e.g., 2h, 15s). The default unit for a plain number is seconds.

SCRIPTING INTEGRATION

The --command option makes termdown highly valuable in shell scripts. For example, termdown -c 'aplay /path/to/sound.wav' 10m will play a custom sound after 10 minutes. This allows for customized notifications or automated task triggering upon timer completion.

HISTORY

termdown emerged as a lightweight, modern alternative to older timer scripts, focusing on a clean terminal interface and simple scripting capabilities. Its development prioritizes ease of use and integration into standard Unix-like environments. It is often distributed via package managers like apt, dnf, or pacman as a community-maintained utility.

SEE ALSO

sleep(1), at(1), watch(1), notify-send(1)

Copied to clipboard