Is there a way to change how long the libnotify notifications last? I've googled around for this for months and no still no luck.

I'm actually starting to think that you can't change it. I can't even find anywhere in the API where developers can control this.

  • Can you please rephrase the question as "How do I change how long notifications are displayed?"; "Notification Display Time" is pretty confusing, and not phrased as a question. – David Siegel Jul 28 '10 at 19:48
up vote 12 down vote accepted

You can't do this normally. However, there is a patched version of notify-osd that supports it:enter image description here

From Ubuntu 16.04 onwards:

You'll need to add two PPA's:

sudo add-apt-repository ppa:leolik/leolik
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update

Then install it like this:

sudo apt-get upgrade
sudo apt-get install notifyosdconfig

The configuration dialog should be in Applications->Accessories or notifyosdconf from the terminal. There's a setting for the standard notification duration as per screenshot above if you don't set it the --expire-time parameter.

Example:

notify-send --urgency=LOW --expire-time=1 --icon=face-laugh "test" "1 second"

Older versions: (9.10-14.10)

You'll need to add two PPA's:

sudo add-apt-repository ppa:leolik/leolik
sudo add-apt-repository ppa:amandeepgrewal/notifyosdconfig
sudo apt-get update

Then install it like this:

sudo apt-get upgrade
sudo apt-get install notifyosdconfig

The configuration dialog should be in Applications->Accessories or notifyosdconf from the terminal. There's a setting for notification duration as per screenshot above.

Example:

notify-send --urgency=LOW --expire-time=1 --icon=face-laugh "test" "1 second"
  • those two ppa's are the same? after googling 'notifyosdconfig ppa' i think the second one you meant was sudo add-apt-repository ppa:amandeepgrewal/notifyosdconfig – helloandre Jul 29 '10 at 0:14
  • Yep, that's it. Thanks, edited post. – snostorm Jul 29 '10 at 11:50
  • Just a note, though the above program works beautifully, you're still limited by a maximum time of 10 seconds. You can go below 10 seconds, but not above (which is what I was after when I started looking). – begtognen Nov 16 '10 at 20:59
  • does this override the default notify-send behaviour or is it a seperate command? – Blauhirn Feb 12 '17 at 19:15
  • Unfortunately, the repository doesnt provide the package anymore, saying E: Failed to fetch http://ppa.launchpad.net/amandeepgrewal/notifyosdconfig/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found – Blauhirn Feb 12 '17 at 19:34

crude but effective and then some - caveat this also kills pending notifications
this can only shorten display times just change the 1.5 in sleep 1.5; below:

ref:
details in Close button on notify-osd?

x-ref:
Expiry time in notify-send notifications

dbus-monitor "interface='org.freedesktop.Notifications'"            \
| grep --line-buffered  "member=Notify"                             \
| sed -u -e 's/.*/sleep 1.5; killall notify-osd/'                   \
| bash

Bookmarks:
self - How do I change how long notifications are displayed?
Expiry time in notify-send notifications

The duration of the notification is, I believe, dependent on the length of the message.

From the perspective of someone who was worked with it indirectly (by using the pynotify module in Python), I have discovered that specifying a duration for a message is not possible.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.