← 返回命令列表

Linux command

tty-clock 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Display a centered clock

tty-clock -c -s

Display in 12-hour format

tty-clock -t -b

Display with a box border

tty-clock -x -C 2

Display UTC time

tty-clock -u -f "[%A %d %B]"

Display in screensaver mode

tty-clock -S -c -s

Display with bouncing motion

tty-clock -r -B

说明

tty-clock is a terminal-based digital clock built with the ncurses library. It renders the current time in large block digits directly in the terminal, with optional date display below. The clock supports various display modes including centering, bouncing animation, screensaver mode, and customizable colors. While running, the clock responds to keyboard commands: K/J/H/L for vi-style repositioning, 0-7 to change color, B to toggle bold, X to toggle the box border, C to center, R for bouncing mode, S to toggle seconds, T for 12-hour format, and Q to quit.

参数

-s
Display seconds.
-S
Screensaver mode; exit on first keypress.
-x
Show a box around the clock.
-c
Center the clock on the terminal.
-C _0-7_
Set clock color (0=black, 1=red, 2=green, 3=yellow, 4=blue, 5=magenta, 6=cyan, 7=white).
-b
Enable bold font.
-t
Use 12-hour (AM/PM) time format.
-u
Display UTC time.
-T _tty_
Display clock on the specified terminal device.
-r
Enable bouncing motion; clock bounces off terminal edges.
-f _format_
Custom date format string (per strftime(3)).
-n
Do not quit on keypress; must be killed with a signal.
-D
Hide the date display.
-B
Enable blinking colon separator.
-d _delay_
Set redraw delay in seconds (default: 1).
-a _nsdelay_
Additional nanosecond delay between redraws.
-i
Display clock information (version, compiled options).
-v
Display version information.
-h
Display help text.

FAQ

What is the tty-clock command used for?

tty-clock is a terminal-based digital clock built with the ncurses library. It renders the current time in large block digits directly in the terminal, with optional date display below. The clock supports various display modes including centering, bouncing animation, screensaver mode, and customizable colors. While running, the clock responds to keyboard commands: K/J/H/L for vi-style repositioning, 0-7 to change color, B to toggle bold, X to toggle the box border, C to center, R for bouncing mode, S to toggle seconds, T for 12-hour format, and Q to quit.

How do I run a basic tty-clock example?

Run `tty-clock -c -s` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -s do in tty-clock?

Display seconds.