LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

clock-rs

Digital clock, timer, and stopwatch for the terminal

TLDR

Show the clock (the default command)
$ clock-rs
copy
12-hour time, without seconds
$ clock-rs -t -s
copy
Show the time in UTC
$ clock-rs --utc
copy
Start a three-minute timer
$ clock-rs timer -M 3
copy
Start a stopwatch
$ clock-rs stopwatch
copy
Quit when the timer reaches zero
$ clock-rs timer -M 5 -k
copy

SYNOPSIS

clock-rs [options] [clock | timer [options] | stopwatch]

DESCRIPTION

clock-rs draws a digital clock in the terminal. With no subcommand it runs clock. timer counts down and stopwatch counts up.Timer units are converted for you: 90 minutes is 1 hour and 30 minutes. The longest timer is 99 hours, 59 minutes, and 59 seconds. A timer with no duration is 5 minutes.A command-line flag overrides the same setting in the configuration file.

PARAMETERS

-c, --color color

Clock color: a name (black, red, green, yellow, blue, magenta, cyan, white), the same name with a bright- prefix, or #rrggbb.
-i, --interval ms
Redraw interval in milliseconds. Must be greater than zero. Default 200.
-B, --blink
Blink the colon.
-b, --bold
Draw the clock in bold.
-x, --x-pos start | center | end
Horizontal position. Default center.
-y, --y-pos start | center | end
Vertical position. Default center.
--fmt format
Date line, as a chrono strftime pattern. Default %d-%m-%Y.
-t
12-hour clock. This flag has no long form.
--utc
Use UTC instead of local time.
-s, --hide-seconds
Omit seconds.
-S, --seconds n
Add seconds to a timer.
-M, --minutes n
Add minutes to a timer.
-H, --hours n
Add hours to a timer.
-k, --kill
Exit when the timer finishes.
-V, --version
Print the version and exit.

CONFIGURATION

The file is TOML. On Linux it is ~/.config/clock-rs/conf.toml. Point the variable CONF PATH (one underscore between the words) at another file, or set it to None to ignore the file on disk:

$ CONF_PATH=None
copy
[general]
color (default white), interval in milliseconds (default 200), blink (default false), bold (default false). These match --color, --interval, --blink, and --bold.
[position]
horizontal and vertical, each start, center, or end. Default center. These match --x-pos and --y-pos.
[date]
fmt is a chrono strftime pattern (default %d-%m-%Y) and matches --fmt. utc matches --utc. The 12-hour key and the hide-seconds key match -t and --hide-seconds. Each of those two keys is two words joined by an underscore: use and 12h, hide and seconds.

INSTALL

brew install clock-rs
copy
nix profile install nixpkgs#clock-rs
copy

CAVEATS

-t is only a short flag. The matching configuration key is the 12-hour key under date.

SEE ALSO

RESOURCES

Copied to clipboard
Kai