Are you looking for something to spice up your terminal and give it a cool appearance? or you want to show off your desktop by displaying a simple digital clock from your terminal. tty-clock might be the right package for you.
With tty-clock, you can display a simple digital clock inside your terminal. Then you can use it for whatever you want.
In this article, you will learn how to install tty-clock on Arch Linux and Manjaro, so you can have an aesthetic display clock on your terminal.
About tty-clock
tty-clock is a simple program written in C that displays the current time in a text-based interface.
When you run tty-clock
in your terminal, it will display a large, ASCII-art-style representation of the current time. The numbers are usually composed of various characters that create a visual representation of the digits.
It’s not meant to be a highly accurate or precise timekeeping tool, but rather a way to add a bit of visual flair to your terminal window.
tty-clock can be launched directly from the terminal by typing the tty-clock command:
tty-clock
after you run this command, it will immediately display the digital clock inside your terminal window.
Interesting right? I know the appearance might look basic for now, but later we will learn how to add a little bit of customization to the tty-clock.
But before diving into that part, you will need to install the tty-clock first on your Arch Linux or Manjaro machine.
Installation
tty-clock is not available to install directly using the pacman package manager. Instead, you can install tty-clock from the AUR (Arch User Repository). There are a lot of available AUR helpers out there that you can use to install AUR packages. For this tty-clock installation purpose, we will be using yay.
Run the command below to install tty-clock:
yay -S tty-clock
The installation process should begin now. Just wait until it is completed.
How To Use tty-clock
Now that you have successfully installed the tty-clock on your system, Let’s learn how to use the tty-clock so you can get the full potential of the tty-clock.
To launch tty-clock, you just need to type tty-clock
in the terminal and then press the Enter key.
tty-clock
This will basically display the current time in a large font in ASCII style. pretty basic, actually.
The default result of the tty-clock
command is actually good enough to display the current time, but surely we can improve things with a little bit of additional argument.
Display Clock at the Center of the Terminal
The default behavior of tty-clock
is to display the clock at the top left corner, which might feel slightly off, as it’s not centered.
But, of course, you can easily overcome this problem. If you have already launched the tty-clock, you can simply press the C
button on your keyboard to center the clock within the tty-clock interface.
Another way to center the clock is by launching the tty-clock with an additional argument:
tty-clock -c
Executing the tty-clock command followed by the -c
argument will instantly render the clock at the center of the terminal.
Display the Seconds
Actually, the tty-clock
can display not only hours and minutes but also seconds. providing a more precise time display.
To launch tty-clock with seconds included, simply append the -s
argument after the tty-clock
command:
tty-clock -s
Alternatively, you can directly toggle the seconds display within tty-clock by pressing the S
button on your keyboard.
Change the Display Color
tty-clock also gives you the option to change the display color of the clock. This will definitely be very useful for customization purposes.
To configure the text color of tty-clock, initiate it with the following format:
tty-clock -C [0-7]
Here’s the breakdown:
The -C
argument is to enable the custom color.
The [0-7] is the number you can choose between 0 and 7 (excluding the square brackets).
The color selection from 0 to 7 is actually taken from your terminal color profile, so you can experiment by trying them one by one to see what color they are.
Example:
Here I set the tty-clock color to use color number 5, which gives me a pink color.
tty-clock -C 5
Feel free to experiment with the other numbers and choose the one that you like the most.
Change the Hour to a 12-hour Format.
By default, tty-clock displays the clock in a 24-hour format, but you can change it to a 12-hour format if you want.
To launch tty-clock
with a 12-hour format, simply add the -t
argument:
tty-clock -t
You can also easily toggle between 12-hour and 24-hour formats by pressing the T
button.
Display in a Boxed Style
You can also add a boxed style around the clock to make it stand out more. Simply launch it with the -x
argument:
tty-clock -x
Alternatively, you can toggle it on and off by pressing the X
button on your keyboard.
Display as Screensaver Mode
Another cool thing you can do in tty-clock is set it as a screensaver, so basically, it will display the digital clock as usual, but the difference is that when you press any key on the keyboard, it will stop displaying the clock.
To do this, you can simply launch it with the -S
argument:
tty-clock -S
Now it will launch in screensaver mode. And you can quit it by pressing any key on your keyboard.
Other Commands
There are still many other commands you can do with tty-clock. You can see the full list of possible commands by running the command below:
tty-clock -h
This will provide you with information like this:
usage : tty-clock [-iuvsScbtrahDBxn] [-C [0-7]] [-f format] [-d delay] [-a nsdelay] [-T tty]
-s Show seconds
-S Screensaver mode
-x Show box
-c Set the clock at the center of the terminal
-C [0-7] Set the clock color
-b Use bold colors
-t Set the hour in 12h format
-u Use UTC time
-T tty Display the clock on the specified terminal
-r Do rebound the clock
-f format Set the date format
-n Don't quit on keypress
-v Show tty-clock version
-i Show some info about tty-clock
-h Show this page
-D Hide date
-B Enable blinking colon
-d delay Set the delay between two redraws of the clock. Default 1s.
-a nsdelay Additional delay between two redraws in nanoseconds. Default 0ns
You can use any of the available options by adding them as an argument after the tty-clock
command.
For example, if you want to use UTC time, you can add the -u
argument:
tty-clock -u
You can also combine it with other options too. Here I combine the -u
and the -c
arguments so it will display in UTC time, and at the same time set the clock to the center of the terminal.
tty-clock -uc
You are free to combine multiple arguments, as many as you want, as long as they are valid arguments.
Uninstall tty-clock
When you don’t need tty-clock anymore, you can easily uninstall it by using the following command:
yay -R tty-clock
This should remove the tty-clock from your Arch Linux or Manjaro system.
Conclusion
If you have reached this section, you should be able to install and use tty-clock on Arch Linux or Manjaro.
tty-clock is a great way to display the current time in a terminal interface. Whether you want to use it for aesthetic purposes or simply to tell the time, tty-clock can fulfill them both.
If you have any difficulties, feel free to ask a question in the comment section below, and I will be more than happy to assist you in resolving the issue.