26

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.

1
  • 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. Jul 28, 2010 at 19:48

3 Answers 3

14

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"
5
  • 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, 2010 at 0:14
  • 1
    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, 2010 at 20:59
  • does this override the default notify-send behaviour or is it a seperate command?
    – phil294
    Feb 12, 2017 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
    – phil294
    Feb 12, 2017 at 19:34
  • Got E: Unable to locate package notifyosdconfig
    – Ole
    Apr 10, 2019 at 21:45
4

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

3

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .