LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
 
Search this Thread
Old 12-10-2012, 09:35 PM   #1
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,450

Rep: Reputation: 84
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

Last edited by fakie_flip; 12-10-2012 at 09:54 PM.
 
Old 12-11-2012, 01:49 PM   #2
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,974

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
What happens when you don't use the -t option at all?

Markus
 
Old 12-11-2012, 03:03 PM   #3
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,450

Original Poster
Rep: Reputation: 84
Same thing as not using it. It makes no difference.
 
Old 12-11-2012, 03:14 PM   #4
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,974

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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
 
Old 12-11-2012, 03:36 PM   #5
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,628
Blog Entries: 1

Rep: Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062Reputation: 1062
Quote:
Originally Posted by markush View Post
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/
 
Old 12-11-2012, 07:08 PM   #6
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,450

Original Poster
Rep: Reputation: 84
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.
 
Old 12-12-2012, 01:21 AM   #7
markush
Senior Member
 
Registered: Apr 2007
Location: Germany
Distribution: Slackware
Posts: 3,974

Rep: Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850Reputation: 850
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
 
Old 12-27-2012, 04:50 PM   #8
fakie_flip
Senior Member
 
Registered: Feb 2005
Location: San Antonio, Texas
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,450

Original Poster
Rep: Reputation: 84
Quote:
Originally Posted by markush View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
notify-send failure brooksbi Linux - Newbie 2 11-16-2012 10:41 AM
notify-send through ssh cccc Debian 0 08-14-2011 07:44 AM
[SOLVED] notify-send notification look (design) michal017 Linux - Software 4 07-21-2011 01:32 AM
Hyperlink --> Notify-Send jv2112 Linux - Newbie 3 06-19-2011 06:39 AM
using notify-send ashikahamed Ubuntu 0 05-02-2008 06:09 AM


All times are GMT -5. The time now is 11:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration