A minimal customizable cross-platform terminal digital clock.
zclock is written from scratch in zig and only uses time.h
and pure zig std.
- Works on windows, macos and linux
- Auto center or manual position in terminal
- Custom date string formatting
- Toggle seconds display
- Toggle between 12 or 24 hour (military) mode
- Change colors to personalize it
- Change clock render style
- Install latest zig master branch.
- Clone this repository.
git clone https://github.com/tr1ckydev/zclock cd zclock
- Build the project.
zig build -Doptimize=ReleaseFast
- Add the binary file from
./zig-out/bin/
to$PATH
.
Press
Ctrl + C
to exit to clock.
Print the help menu to see the available options.
zclock --help
--fmt=<FORMAT>
: See strftime manual for available format specifiers.--color=<NAME>
: See zig docs for valid color names.--style=<STYLE>
:default
|line
When using Windows Terminal or Windows Console Host, sometimes flickering of the clock can be observed when it redraws itself on the terminal after each second.
Switch to unix-like terminals such as MinGW terminal (e.g. Git Bash), Cygwin terminal for a flicker-free experience.
Thanks to peaclock for inspiring this project.
This repository is licensed under the MIT License. Please see LICENSE for full license text.