_ap_ufes{"success":true,"siteUrl":"www.jucktion.com/tech","urls":{"Home":"https://www.jucktion.com/tech","Category":"https://www.jucktion.com/tech/c/mobile/android/","Archive":"https://www.jucktion.com/tech/2018/12/","Post":"https://www.jucktion.com/tech/windows-network-traffic-analysis-single-app/","Page":"https://www.jucktion.com/tech/about/","Attachment":"https://www.jucktion.com/tech/windows-network-traffic-analysis-single-app/capture-traffic-specific-application/","Nav_menu_item":"https://www.jucktion.com/tech/3985/"}}_ap_ufee Creating custom Ubuntu notifications and reminders - Tech Junction

Creating custom Ubuntu notifications and reminders

By | 27th August, 2013 | 0 Comments

Ubuntu being my most used operating system at the moment, i explored if i could get custom notifications to pop up notifying me of something to do. So i found two ways to accomplish this with the terminal or any other application that could execute a command. The two ways i found were “zenity” and “notify-send”. Lets see what we can do with these commands.

Both of these are terminal commands so you can either setup delays to execute these commands on your Terminal or use applications like KAlarm or KTimer (available on software-center) to setup multiple notification according to your need. KTimer is straightforward and allows easy usage of timers and command execution, but KAlarm allows more features and options you might like.

ktimer with zenity notification

Zenity allows you to create pop ups like JavaScript on web sites that you have to click to close. This makes the pop up remain there until you take an action to close it. If you were to make notification like on Ubuntu they will vanish after some moments and you may miss the notification. Here’s a simple example of zenity command:

zenity –info –text=”Time for meeting”

The notification would pop up a windows with your notifications like this:

zenity-notification-window

You can use notify-send to create default notifications like on Ubuntu. But these notification will vanish after some moments and you’ll miss those notification if you’re not actively using the system. You can use these on KTimer or KAlarm to create multiple notification as per your need. The simple command to get those notification is:

notify-send “Title” “Message” -i \icon.png

The notify-send –help option shows basic usage. More examples can be found here.

Title is for the heading of the notification and Message is for your message to be shown. -i is to show a icon with that notification. No need for any screen shots with notify-send as it is the same as the default Ubuntu notification you might have seen a lot of times already.

Let us know what you think in the comments.

Tags: , , , , ,

Category: Linux