xclock is a terminal-based clock application written in Rust, inspired by ttyclock. It features a digital clock with ASCII art, countdown timers, and various customization options.
- Clock Mode: Displays current time with seconds.
- Countdown Mode: Set a timer using formats like
5m,1h30m,10s. - Customization:
- Center alignment.
- Colors (red, green, blue, yellow, cyan, magenta, white, black).
- 12/24 hour format.
- Toggle seconds (
-sto show). - Hide/Show box borders.
- Cross-platform: Works on Linux, macOS, and Windows.
You can install xclock using the provided script. It will auto-detect your OS (Arch/Ubuntu/Fedora/macOS), install Rust if missing, and then install xclock:
./install.shOr remotely:
wget -O - https://raw.githubusercontent.com/xscriptordev/xclock/main/install.sh | bashRun the PowerShell script:
./install.ps1- Linux/macOS:
./uninstall.sh - Windows:
./uninstall.ps1
xclock [OPTIONS]| Option | Description |
|---|---|
-c, --center |
Center the clock on the screen |
-C, --countdown <TIME> |
Enable countdown mode (e.g., 5m, 1h30m) |
-s, --seconds |
Show seconds (default: off) |
-r, --color <COLOR> |
Set color (default: green) |
-t, --twelve-hour |
Use 12-hour format |
-B, --no-box |
Hide the box borders |
-h, --help |
Print help |
Seconds are disabled by default to mimic ttyclock. Use -s to show them.
Run a centered green clock:
xclock -c -r greenRun a 5-minute countdown:
xclock -C 5mRun a clock without box and seconds:
xclock -BBuilt with Rust, using ratatui and crossterm.
cargo run --release