Kubuntu: Configuring Timer Widget

I like to work using an adapted Pomodoro technique, therefore I added a timer widget to my desktop (I use Kubuntu as my operating system). Unfortunately, in Kubuntu by default when the timer ends, there is no sound notification about this event. Moreover, the set of predefined timer intervals does not fit my needs. In this short post, I explain how to make the timer widget more comfortable.

Configuring Timer End Ring

You can configure the timer to pop up textual notification in the notification area. In order to do this right click on a timer widget and select the “Configure Timer…" option. In the opened window, tick the checkbox “Notification” and add “Show notification text” into the textarea like it is shown in Figure 1:

Configuring Timer Notification
Configuring Timer Notification

However, beside the visual signal I like to receive an audio signal about the time end event (this is especially useful when you are doing something not in front of your computer). Unfortunately, there is no configuration option to play a sound after the timer ends. However, the “Advanced” tab provides the “After the timer completes: Execute command” functionality that we will facilitate to play a sound.

Configuring Advanced Options
Configuring Advanced Options

In order to do this, we need to find a command starting a utility that will play a selected sound. I search for the Internet, and found several options of the utilities that can be called from a command line so that their execution will not launch a window. So as by default my system is supplied with the VLC player installed that can be used to play a sound in a background, I have decided to use this utility to achieve my goal. Thus, into the “Execute command” textarea I put the following command:

cvlc --play-and-exit /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga

The cvlc runs a minimal vlc player. The --play-and-exit option stops the process after the sound is played. The last argument is the path to the sound file. In my case, I use one of the default sounds supplied with the system.

Configuring Predefined Timer Intervals

In order to configure the default timer intervals, we need to modify configuration files. It was an easy task to find out where these configuration values are stored. The hack I used to find out where the configuration is stored, was in running the strace utility on the plasmashell process and checking all the discovered paths.

So, after spending some time in analyzing the obtained results, I have found out that the defatult interval values are store in the file: /usr/share/plasma/plasmoids/org.kde.plasma.timer/contents/config/main.xml. Open this xml file and modify the list of values in the predefinedTimers entry (the intervals there are given in seconds):

# sudo nano /usr/share/plasma/plasmoids/org.kde.plasma.timer/contents/config/main.xml

In my case, this entry looks now in the following way:

<entry name="predefinedTimers" type="StringList">
    <default>30,60,120,300,450,600,900,1200,1500,1800,2700,3600,5400</default>
</entry>

Now, log out or restart your computer and the new interval values should appear in the timer list.

Timer Intervals
Timer Intervals

Conclusion

I add this article to the blog mostly for myself because I configure timer widget rarely, and therefore I often forget the steps (and the path to the audio file) how to do this. However, if it can be useful for someone else I will be happy.

Yury Zhauniarovich
Yury Zhauniarovich
Assistant Professor

Related