Do you like to see a pop-up message near your system tray that gives information about the time a system has been up? This can be easily done with the 'notify-send' command line tool.
notify-send can be used to send desktop notifications to the user from the command line. It has many useful options that help to inform a user about an event. Do you guys know what do we need now?
We need a terminal (CTRL+ALT+T if you are using Ubuntu). I like to experiment alot and try things out, so let me run the following command in my terminal and see what happens.
notify-send 'Linoxide Notifications'
Upps, this is what i get after running the above command.
It is time to try another command, cool stuff.
You can see that we can specify a title for the message we want to send, in our case the title is 'Linoxide Notification'.
The message will be not displayed for a long time on the screen, but the -t option can be used in this case to specify the timeout in milliseconds.
notify-send 'Display this message for 13 seconds' -t 13 000
A very nice option that i like to use is the --icon (-i) option which specifies an icon filename or stock icon to display.
Do you want to give a try to the following command?
notify-send -i "notification-network-wireless-low" 'Wireless' 'Weak Signal'
How did i find this notification icon? There is a list of notifications icons here in the bottom of the page, but since i am a nice and caring guy i will share some of these icons with you guys.
Some notification icons you may need in the future:
Yes, it is the moment to cook a very simple but useful bash script which will help us to display a notification near your system tray about the time your system has been up.
while [ 1 ]; do
notify-send 'Uptime' "`uptime`"
The above script will run forever and it will execute the notify-send 'Uptime' "`uptime`" command which will help us to get information about system's uptime.