In this article, I will show you how to set timers, alarms and stopwatches on your CentOS 8 system. We will perform these steps in two different ways. First, using:
- Graphical user interface
In the GUI we will use the GNOME Clocks utility, in the command line we will use the timer and sleep command.
Using the Gnome Clocks utility
Gnome Clocks is a utility that helps the user to display the date and time in various places. Using this utility, users can set alarms and use stopwatch in one application.
Here we will demonstrate that if this utility is not already installed on your system, then how can you install and use it on your CentOS 8 system.
How to install Gnome Clocks on CentOS 8
The Gnome Clocks application is present in the CentOS 8 repository. You can directly install it using the GUI. Click “Actions” and type “Gnome Clock” in the application search bar, or you can also find this utility directly to enter the software. In the search results list, select Gnome Clock and click on it. The following screen will appear:
Here you will click the “install” button to start the installation process. As you will see, the installation progress bar displays as follows:
After the installation process is complete, the following screen appears on your desktop:
Using the above dialog options, you can directly launch Gnome Clocks, or if you want to uninstall it for any reason, you can uninstall it like this:
You start Gnome Clocks by typing it into the app launcher search bar as follows:
You can also run this tool from the command line by running the following command: Declaration
When Gnome Clocks opens on your CentOS 8 system, the following window will appear. You can add a world clock according to your location and time zone as follows:
On the next tab of the Gnome Clocks window, click the Alarm tab. Here you can add a new alarm by clicking the Add Alarm button as follows:
Now you need to configure the following parameter in the dialog:
- Set alarm time
- Set the day (s) for the alarm to repeat on these days
- It is not necessary that you can name the newly set alarm.
After you have entered all the alarm information, click the Add button to set up this alarm as follows:
After you have saved the alarm, you can also edit it from the alarm list in the edit option.
Similarly, you can also remove an alarm from the alarm delete or delete option as follows:
Click the stopwatch tab. You will see the following view:
Here you can do the following:
Press the Start button to start the stopwatch. Using the lap button, count the laps on the running stopwatch as follows:
Continue the stopped stopwatch, use the Resume button, and if you want to reset the stopwatch, you will use the Clear button as follows:
Click the Timer tab to open the timer view as follows:
Here you can select the duration of the timer. Press the start button to start the timer and the pause button to stop the running timer.
Using the command line or terminal
You can set alarms, timers and stopwatch by running the following commands on the terminal. These commands are almost identical to all Linux distributions. Here we are implementing CentOS 8.
Open a terminal using the keyboard shortcut Ctrl + Alt + t.
Set timer on command line
To install the timer utility, enter the following command:
$ curl -o ~/timer https://raw.githubusercontent.com/rlue/timer/master/bin/timer
$ sudo chmod +x ~/timer
To get help related to the timer, run the following command:
$ ./timer –h
For example, you will use the following command to set a timer for 10 seconds:
$ ./timer -d 10
To set the time to 1 minute, use the following command:
$ ./timer 1
Start stopwatch using terminal
To start the stopwatch using the terminal, run the following command on the terminal:
$ time cat
After executing the above command, nothing will be printed on the terminal. When you quit the terminal using the keyboard shortcut Ctrl + C. After that, you will see the time between startup and shutdown is displayed as follows:
Set an alarm using the terminal
To set an alarm using the terminal, follow these steps:
- First, you will save the alarm as an mp3 file.
- Run the following command to set the sleep time before playing mp3 alarm.
$ sleep [x]hour [x]m && mplayer /path/to/file.mp3
For example, you want to turn on the alarm after 4 hours.
$ sleep 4h && mplayer /Music/alarmtone.mp3
$ 10 million sleep – Use this terminal command wait 10 minutes
$ 10 seconds sleep –Wait terminal 10 seconds
$ 10 hours sleep – waiting terminal 10 hours
$ sleep 10 days – wait for the terminal 10 days
In this article, you learned how to set alarms, timers, and stopwatches using the GUI as well as the command line. Hope you find this article helpful. Alternatively, you can explore other terminal commands. Please leave us your feedback in case of any problems in the comments in the comment box.
How to set timers, alarms and stopwatches in CentOS 8