aMSN Forums
November 01, 2020, 12:24:47 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New forum for aMSN !!
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: [Solved] Notify plugin: add parameters to notify-send path  (Read 28549 times)
nico@nc
Newbie

Offline Offline

Posts: 11



View Profile WWW
« on: September 28, 2008, 08:18:57 pm »

Hi,

I installed today the Notify plugin and I would like to add settings to the basic notify-send command:

such as --expire-time=3000, as otherwise the notification stays in the corner of my screen until I click on it.



But as soon as I change notify-send to notify-send --expire-time=3000 or notify-send -t 3000, I don't get any more notification popup, just the sound. I tried to load the previous codes right from the command line, and they work well.

Is there any way to do this?

Thanks for your help.
Logged

Nicolas | Mozillian | Ubuntero
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9425


View Profile WWW
« Reply #1 on: September 29, 2008, 01:16:03 am »

humm.. I would suggest you modify the source code.. I'm guessing when you add the --expire-time=300 it tries to execute the command "notify-send --expire-time=3000" as if it was the name of the command (the exeuctable filename would contain the space and the "--expire-time=3000" that's probably why it doesn't work. You can probably see it in the plugins log (alt-P).
You can however modify the code of the plugin (which should be simple) to add a new configuration entry for 'options' and give it those options when launching the app.
If you do that, then please send the patch so others can enjoy it.
You could however just hack it by hardcoding the --expire-time=3000 in the plugin, so it would only fix it for you.
Logged

KaKaRoTo
nico@nc
Newbie

Offline Offline

Posts: 11



View Profile WWW
« Reply #2 on: September 29, 2008, 06:12:53 pm »

You are right, it looks like what you are saying.

If found some things about --expire-time in the plugin code:
Code:
# thx authors of the music plugin
proc exec_notify { txt {email ""} {urgency "normal"} {expire -1} {category "im.received"} {hint ""} } {
global HOME
variable config
log "exec_notify lvl 1"
       
       set status [::MSN::myStatusIs]
       if { $status == "BSY" && $config(notify_busy) != 1} {
log "You are busy, so not disturbing you"
return
       }

set notify $config(notify_send)
set urgency "--urgency=$urgency"

if { $expire == -1 } {
set expire [::config::getKey notifytimeout]
}
set expire "--expire-time=$expire"

...but I don't know how to set this. I tried Ctrl+S and ::config::getKey notifytimeout 3000 but it doesn't change anything. :?

edit... actually, the plugin says that it requires aMSN 0.98 (even if it is written 0.97 on the download page), so I modified the version to 0.97.2 which I am using, but the problem is maybe that the code is not done to be working with this version?
Logged

Nicolas | Mozillian | Ubuntero
Fabioamd87
Super Power User
**
Offline Offline

Posts: 467



View Profile
« Reply #3 on: September 29, 2008, 06:36:42 pm »

I've a question:does this plugin use the gajim's system for notification?

this would be great because amsn notify is very slow and many times it remain blocked and hidden (it shows only the top part) and after few seconds it is completely visible but this is annoyng because it disappear fast.
Logged
nico@nc
Newbie

Offline Offline

Posts: 11



View Profile WWW
« Reply #4 on: September 29, 2008, 06:58:30 pm »

According to this (fixed) ticket, Gajim now uses notify-send (which is the defaut notification tool in Ubuntu and probably other distros) as Notify plugin do. So the answer should be yes.
Logged

Nicolas | Mozillian | Ubuntero
kjir
Power user
*
Offline Offline

Posts: 133


View Profile
« Reply #5 on: September 29, 2008, 07:24:48 pm »

Quote from: "nico@nc"

...but I don't know how to set this. I tried Ctrl+S and ::config::getKey notifytimeout 3000 but it doesn't change anything. :?


Well for starters I would try with ::config::setKey notifytimeout 3000, maybe you're lucky and it works
Logged
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9425


View Profile WWW
« Reply #6 on: September 29, 2008, 08:03:34 pm »

nico@enc :
Code:
        set expire [::config::getKey notifytimeout]

The notifytimeout option is configurable in the advanced prefs.. so :
menu account->preferences->advanced tab->My Event Alerts and Sounds ->Number of milliseconds before notify window disappears.
It defaults to 8000, you can set it to 3000 in there and the notify plugin should take it automatically...
Logged

KaKaRoTo
nico@nc
Newbie

Offline Offline

Posts: 11



View Profile WWW
« Reply #7 on: September 29, 2008, 08:05:29 pm »

Ok, actually notifytimeout is an amsn setting for the "normal" notification window, reused by the notify plugin to set the notification expire-time.

But the problem with the Notify plugin is that I get both the "normal" amsn notification and notify-send notification; as a workaround I set the timeout to 0 ms in amsn settings in order not to see the amsn notification... and of course the expiry-time is set to 0, which means infinite!

Now, I don't know if the bug of the amsn notification appearing is a notify plugin bug, or if it is intended to work with amsn 0.98. In this case, I'll edit the plugin file so that it does not look at amsn expiry time or notification activation status.
Logged

Nicolas | Mozillian | Ubuntero
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9425


View Profile WWW
« Reply #8 on: September 29, 2008, 08:21:14 pm »

humm... right, well, I don't know why the plugininfo.xml says it requires 0.98b, I don't see what's missing and I don't know how it's supposed to prevent the showing of notify windows... the author of the plugin will soon answer you...
Logged

KaKaRoTo
Yoda-BZH
Newbie

Offline Offline

Posts: 6


View Profile
« Reply #9 on: September 29, 2008, 08:31:08 pm »

the plugin uses the time specified in amsn's preference window (preferences, advanced, my alerts and sounds)

If you don't want to have amsn's own notification system, disable it in preferences, appearence, my alerts and sounds, and disable [ ] show a window when an event occurs (not sure of the translation btw)
Logged
Fabioamd87
Super Power User
**
Offline Offline

Posts: 467



View Profile
« Reply #10 on: September 29, 2008, 08:54:22 pm »

Quote from: "Yoda-BZH"

If you don't want to have amsn's own notification system, disable it in preferences, appearence, my alerts and sounds, and disable [ ] show a window when an event occurs (not sure of the translation btw)

is possible to do this automatically when you start this plugin?
Logged
nico@nc
Newbie

Offline Offline

Posts: 11



View Profile WWW
« Reply #11 on: September 29, 2008, 08:59:53 pm »

Quote from: "Yoda-BZH"
If you don't want to have amsn's own notification system, disable it in preferences, appearence, my alerts and sounds, and disable [ ] show a window when an event occurs (not sure of the translation btw)

Great! I tried this before, but with wrong settings of notify-send path so I didn't get any notification at all.

...but when I disable this option, I don't have any more sound with the notification, even if the checkbox below about sounds is checked! amsn bug?
Logged

Nicolas | Mozillian | Ubuntero
kakaroto
Administrator
Super Power User
*****
Offline Offline

Posts: 9425


View Profile WWW
« Reply #12 on: September 29, 2008, 10:46:03 pm »

humm.. not amsn bug, it's because the sounds are played by the notification window function... so yeah, no notifs = no sound... ok, maybe it can be considered a 'bug'... Sad
Logged

KaKaRoTo
Yoda-BZH
Newbie

Offline Offline

Posts: 6


View Profile
« Reply #13 on: September 30, 2008, 10:51:08 am »

erf :s
Logged
nico@nc
Newbie

Offline Offline

Posts: 11



View Profile WWW
« Reply #14 on: September 30, 2008, 04:58:17 pm »

In the preferences, there are two distinct options in Appearance > My alerts and sounds :
(1) ☑ Show notification window when some events happen
(2) ☑ Play a sound when a contact log in or a message is received (or something like that)

If (2) is not possible if (1) is not activated, it should be grayed (and then, there is a problem for Notify plugin); or (2) should be possible even if (1) is not activated (but this is maybe more things to change...).
Logged

Nicolas | Mozillian | Ubuntero
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!