Ubuntu – Can I make centered desktop notifications



Now I am currently using osd_cat, installed with xosd.
It does the job perfectly for me since it is customizeable to my needs.
You can even choose a font from the output of xlsfonts

Original Post

I would like to overlay custom text as a notification.

It is important that the notification is non obtrusive (does not take away window focus).

I made an 8 second video to show what I am trying to do:

8 second sample clip

I am aware of zenity, xmessage, and notify-send, and I don't think any of these can do what I am trying to do.

I am willing to use png's as overlays if custom text is harder to do.

This was inspired by Linux Mint's Change Workspace OSD:

Linux Mint's Change Workspace Screenshot

Best Answer


After some research , I have found a gnome-osd package, which by the way uses python, and installed simply with sudo apt-get install gnome-osd.

The properties , such as text location can be configured with gnome-osd-properties tool. Sending messages is the same syntax as notify-send. The notifications are non-obtrusive. I've tested that with command sleep 10; gnome-osd-client "This is a test message" and switched on working in firefox until the text came up; I was still able to write in firefox even when notification was drawn on the screen.

Bellow you can see the example with test message:

enter image description here

Another alternative is to use osdsh , which works pretty much the same, launch the daemon with osdsh , configured with osdshconfig and send message with osdctl -s "TEST STRING"

Original Post

notify-send doesn't specify options for location. Use zenity or xmessage

zenity gives centered popups by default. Example :

zenity --info --text "Hello world"

xmessage has to be configured according to -geometry flag specified in man page for X (man x). But you need to know size of your screen, which can be found with xrandr , xprop -root , or xwininfo -root. Example:

xmessage "Hello world" -geometry 250x250-130+100
Related Question