How to set timers, alarms and stopwatches on Debian 10. a

s2 0

In this article we explain how to set timers, alarms and stopwatches on your Debian system. We’ll explain the following two ways to do this:

  • Via the user interface with the Gnome Clocks tool
  • Via the command line with various tricks and hacks

We ran the commands and procedures mentioned in this article on a Debian 10 Buster system.

By gnome clocks (GUI)

GNOME Clocks is a simple application to display the time and date in multiple locations and to set alarms or timers. The software also includes a stopwatch. In this section we explain how to install Gnome Clocks if it is not already available on your system. Then we will tell you how to use the utility.

Install GNOME clocks

For a person who does not want to open the command line often, installing software that is present in the Debian repository is very easy through the user interface. On your Debian desktop activities toolbar / dock, click the software icon.

In the software utility, click the search icon and type Gnome Clocks in the search bar. In the search results, the Gnome Clock entry is listed as follows:

This package is developed and maintained by the Debian Stable Main Repository.

Click on Gnome Clocks and the following view will appear:

install a software

Click the Install button to start the installation process. The following authentication dialog will be displayed so that you can provide your authentication details as only an authorized user can install software on Debian.

Authenticate as admin user

Enter your password and click the Authenticate button. After that, the installation process begins and shows a progress bar as follows.advertising

Software will be installed

Gnome Clocks will then be installed on your system and you will receive the following message after successful installation:

GNOME clocks

The above dialog box allows you to launch the software directly and even remove it immediately for whatever reason.

Start GNOME clocks

You can start Gnome Clocks either by looking for it in the Application Launcher bar, or directly from the application menu:

Clocks

To start the tool from the command line, you need to enter the following command in the terminal:

$ gnome-clocks

The Gnome Clock application opens in World View by default.

Watch application

Set up an alarm

Click the Alarm tab and then click the New button to set a new alarm. The following new alarm is displayed as follows:

Set up an alarm

With this dialog you can:

  • Set the alarm time
  • Give your alarm clock a name
  • Set the days when you want to repeat the alarm
  • Use the slider to mark / uncheck the alarm as active

After you have set all the details, use the Done button to save the alarm. After the alarm has been saved, you can edit it at any time by opening it from the alarm list in the alarm view.

To delete an alarm, right click on it; This marks the alarm as selected. You can then delete it by clicking the Delete button at the bottom right.

Use the stopwatch

Click the Stopwatch tab to open the Stopwatch view.

With this view you can:

  • Start a stopwatch with the start button
  • Stop a running stopwatch with the stop button
  • Mark laps on a running stopwatch with the lap button
  • Continue a stopped stopwatch with the Next button
  • Use the reset button to reset the stopwatch to 00:00

Use the stopwatch

Use the timer

Click the Timer tab to open the time view:

Use the timer

You will see that the default time for the timer is set to 5 minutes. In the timer view you can:

  • Set a user-defined time for the timer
  • Start the timer with the start button
  • Interrupt a running timer with the Pause button
  • Continue a paused timer with the Next button
  • Reset the timer using the reset button

From the Debian command line – the terminal

After thorough research, I couldn’t find a single tool that offers the timer, stopwatch, and alarm functionality. However, below are some tools and tricks that you can use to achieve your goal.

You can open the terminal by searching in the application launcher.

Set the timer

Enter the following commands to install the timer utility:

$ curl -o ~/timer https://raw.githubusercontent.com/rlue/timer/master/bin/timer
$ sudo chmod +x ~/timer

Install the timer command line tool

Use the following command for help using this utility:

$ ./timer -h

Linux timer command

For example, the following command runs the timer for 1 minute:

$ ./timer 1

The following command sets the timer to 10 seconds:

$ ./timer -d 10

Use the terminal as a stopwatch

This is a little hack that will turn your terminal into a stopwatch. Run the following command:

$ time cat

The command does not print anything until you exit. As soon as you end the command using the key combination Ctrl + C, the time between execution and the end of the command is displayed as follows:

Time command

You can use this time-lapse as a stopwatch in your terminal.

Set an alarm through the terminal

Okay, here’s another trick! With the sleep command you can easily set an alarm for your system. This is how the sleep command works:

Sleep $ 10m – makes your terminal wait 10 minutes

Sleep $ 10s – makes your terminal wait 10 seconds

Sleep $ 10h – makes your terminal wait 10 hours

And,

Sleep $ 10 days – makes your terminal wait 10 days

The terminal will run the next prompt / command after the sleep command finishes. Usually, however, we want an alarm to play as a wake-up call. How about integrating the sleep command into a command that plays an alarm sound for you.

Step 1: Save an alarm sound as an mp3 file in your system

Step 2: Use the command below to wait / sleep for a certain amount of time before playing your MP3 alarm sound

$ sleep [x]H [x]m && mplayer /path/to/file.mp3

For example:

$ sleep 4h && mplayer /Music/alarmtone.mp3

This command will play your alarm tone after 4 hours.

So these were some of the ways in which you can use your Debian system as an alarm clock, stopwatch, and timer.

How to set timers, alarms and stopwatches on Debian 10. a