LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   notify-send and clearing notifcations (https://www.linuxquestions.org/questions/linux-newbie-8/notify-send-and-clearing-notifcations-4175440902/)

fakie_flip 12-10-2012 09:35 PM

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.

My script:

Code:

[bull:~]$ cat bin/beepwrapper
#!/bin/sh
DISPLAY=:0 notify-send -t 5000 'WeeChat!' 1> /dev/null 2>&1
aplay ~/.weechat/bell.wav 1> /dev/null 2>&1

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

http://expectusafterlun.ch/screenshot.png

markush 12-11-2012 01:49 PM

What happens when you don't use the -t option at all?

Markus

fakie_flip 12-11-2012 03:03 PM

Same thing as not using it. It makes no difference.

markush 12-11-2012 03:14 PM

Well, I don't know what weechat is. I'm using notify-send with some scripts and have no problems. Could you please explain what weechat is?

Markus

sycamorex 12-11-2012 03:36 PM

Quote:

Originally Posted by markush (Post 4847241)
Well, I don't know what weechat is. I'm using notify-send with some scripts and have no problems. Could you please explain what weechat is?

Markus

An irssi alternative.
http://www.weechat.org/

fakie_flip 12-11-2012 07:08 PM

The problem doesn't have anything to do with weechat. If i ran

notify-send -t 5000 'WeeChat!' 1> /dev/null 2>&1

from the command line 1000 times, it would show 1000 notifications at the bottom.

markush 12-12-2012 01:21 AM

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.

How did you configure notify-send?

Markus

fakie_flip 12-27-2012 04:50 PM

Quote:

Originally Posted by markush (Post 4847517)
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.

http://i.imm.io/QHOH.png

Quote:

How did you configure notify-send?
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.


All times are GMT -5. The time now is 04:54 PM.