Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495
Rep:
notify-send and clearing notifcations
I have a script that sends me notifications from weechat using notify-send in Fedora 17 64-bit with cinnamon (it's not linux mint, just borrowed some of their themes). The script runs notify-send with an expiration time of 5 seconds / 5000 milliseconds.
Code:
[bull:~]$ notify-send --help
Usage:
notify-send [OPTION...] <SUMMARY> [BODY] - create a notification
Help Options:
-?, --help Show help options
Application Options:
-u, --urgency=LEVEL Specifies the urgency level (low, normal, critical).
-t, --expire-time=TIME Specifies the timeout in milliseconds at which to expire the notification.
-a, --app-name=APP_NAME Specifies the app name for the icon
-i, --icon=ICON[,ICON...] Specifies an icon filename or stock icon to display.
-c, --category=TYPE[,TYPE...] Specifies the notification category.
-h, --hint=TYPE:NAME:VALUE Specifies basic extra data to pass. Valid types are int, double, string and byte.
-v, --version Version of the package.
However, these notifications are not going away after 5 seconds, and after a few days, I have 800 something notifications. If I try to click on it, the computer gets sluggish for a while trying to open that many. I'd like for these just disappear after 5 seconds or never stored in notifications in the first place.
EDIT: After more googling, I found 'notify-send --hint=int:transient:1 Test' is supposed to cause the message not to appear in the list of notifications. However, as soon as the notification pop up disappears, it does get stored. Maybe this only works in Gnome 3? Not sure
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495
Original Poster
Rep:
Quote:
Originally Posted by markush
Hi fakie_flip,
I've tried
Code:
for i in {1..1000}; do notify-send -t 2000 "hello$i" 1> /dev/null 2>&1; done
the notifications expire after two seconds, but they are not all shown at the top right (as configured) but evenly spread over the screen.
I'm using Cinnamon in Fedora as I said in my first post. They do not go away after 2 seconds with -t 2000. Check the timestamps I made with the date command.
I'm not sure what you mean by that. AFAIK, there's not a configuration file. I showed the options being used in the script. If you meant the configure script from autotools, I didn't compile it from source. The Fedora package maintainers did that. I have libnotify-0.7.5-1.fc17.x86_64.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.