Notify-send ignores timeout?
Solution 1:
This is a known bug: https://bugs.launchpad.net/ubuntu/+source/notify-osd/+bug/390508
(It is considered a 'design decision' by the maintainer.)
Solution 2:
As mentioned in one of the posts above, there is a design decision to disallow this feature. Fortunately for you, other people disagree as well and have set up a PPA and you can reverse this decision for your system as well.
To solve your problem just:
sudo add-apt-repository ppa:leolik/leolik
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install libnotify-bin
pkill notify-osd
Optional
To add even more features to send-notify than you currently have:
From Ubuntu 16.04 onwards:
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt update
sudo apt install notifyosdconfig
For versions 9.10-14.10:
sudo add-apt-repository ppa:amandeepgrewal/notifyosdconfig
sudo apt-get update
sudo apt-get install notifyosdconfig
For more information on the solution above, read this article:
Configurable Notification Bubbles for Ubuntu
Solution 3:
This was an intentionally implemented contravention of established conventions without disqualification in the host terminal environment. ie. notify-send
should no longer exist since it compromises the well-established expected and documented functionality, so instead, a new command notify-graffiti
should now exist - What???? Wait a second ... all those scripts that use the "conventional" command name spelling will be compromised!?! by changing the convention of how the command name is spelled?!?! - hmmm This philosophy is exceptionally, paradoxically hypocritical as espoused by the Unity desktop terminal interface.
It can't be done both ways - preserving some conventions ie. the name of a command and yet not others, the functionality of a command as documented. If the functionality is to be compromised then so too should the command name so as to maintain integrity, conventionality, consistency, etc. of the user "experience", or is that user "frustration", "annoyance", "irritation", ...
ref:
- for details see: What is the name of the program that displays the notifications?
- check "
man notify-send
" - see section Non-expiring_notifications in the Ubuntu document Notification | Ubuntu App Developer
Bookmark:
Notify-send ignores timeout?
Solution 4:
There is a small handy script notify-send.sh as a drop-in replacement for notify-send that enables you to close or replace previously sent notifications.
Edit: as @Glutanimate pointed out, this script supports expiration-time by default.
I couldn't get expiration-time to work in the end, so I went rather a hacky way to send a notification with 2 seconds timeout like this:
notify-send.sh --print-id test | xargs -I {} bash -c "sleep 2 && notify-send.sh --close={}" &