Salix Update Notifier - Multiple Notification Icons

You think you have found a bug? Let us know about it.
User avatar
ray
Posts: 87
Joined: 20. Mar 2010, 10:28
Location: United Kingdom

Salix Update Notifier - Multiple Notification Icons

Post by ray »

The Salix Update notifier script puts an icon on the sys tray if it detects updates are available.
However, if i decide not to do my updates and wait, after a period of time, it adds another icon as well. This way, given enough time, we will end up with quite a few icons :)

Perhaps the script should be modified to remove the current icon before adding another?

Cheers,
ray
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: Salix Update Notifier - Multiple Notification Icons

Post by damNageHack »

ray wrote:Perhaps the script should be modified to remove the current icon before adding another?
Better add only a new one if there is not already one :)
But I wonder how this could be solved due to the usage of zenity ... :? Maybe with some kind of a lock file. You would have to check in both cases for a running zenity process (that shows the icon).

But ... why are you using the update notifier if you are not interested in updates? You can also increase the interval to check for updates.
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.
User avatar
ray
Posts: 87
Joined: 20. Mar 2010, 10:28
Location: United Kingdom

Re: Salix Update Notifier - Multiple Notification Icons

Post by ray »

damNageHack wrote:
ray wrote:Perhaps the script should be modified to remove the current icon before adding another?
Better add only a new one if there is not already one :)
But I wonder how this could be solved due to the usage of zenity ... :? Maybe with some kind of a lock file. You would have to check in both cases for a running zenity process (that shows the icon).

But ... why are you using the update notifier if you are not interested in updates? You can also increase the interval to check for updates.
I've been looking at trying to modify the script since i posted this, but i havent yet found a way to do so. I'm no expert at bash, so maybe someone else can find a way.

Well, my current scenario is pretty rare, but It's pretty normal scenario where you are Working on/Downloading something so you might want to postpone the update to later.

Cheers,
ray
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: Salix Update Notifier - Multiple Notification Icons

Post by damNageHack »

You can not solve that problem due to zenity (the icon process) runs as another process. Either you terminate that process after some time or inactivity (no reaction from user) or it runs forever if no other process (e.g. in thaour case the update-notificater scrpit) terminates or kills it.
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.
User avatar
ray
Posts: 87
Joined: 20. Mar 2010, 10:28
Location: United Kingdom

Re: Salix Update Notifier - Multiple Notification Icons

Post by ray »

One way i can think of is to move the zenity notification icon to a seperate script, so we can track the pid and kill it before showing another.

Will try and give it a whirl.

Cheers,
ray
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: Salix Update Notifier - Multiple Notification Icons

Post by damNageHack »

Maybe try something like the following. You should only have to change the line
zenity --notification \
to
pgrep -f zenity.+salix || zenity --notification \
ray wrote:One way i can think of is to move the zenity notification icon to a seperate script, so we can track the pid and kill it before showing another.
I think no good idea with a pid or lock file. If the process will be killed or crashes for some other reasons you will stick with that file and the user will never get a notification any more.

EDIT:
Although, I can not reproduce it here with Salix Live 13.1.1 LXDE. The icon shows up again only if I've clicked on it before, but there is never more than one icon. Maybe my work around helps anyways.
Last edited by damNageHack on 18. Sep 2010, 22:43, edited 1 time in total.
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.
User avatar
ray
Posts: 87
Joined: 20. Mar 2010, 10:28
Location: United Kingdom

Re: Salix Update Notifier - Multiple Notification Icons

Post by ray »

damNageHack wrote:Maybe try something like the following. You should only have to change the line
zenity --notification \
to
pgrep -f zenity.+salix && zenity --notification \
EDIT:
Although, I can not reproduce it here with Salix Live 13.1.1 LXDE. The icon shows up again only if I've clicked on it before, but there is never more than one icon. Maybe my work around helps anyways.
That way you will end up with multiple pid's if you have different zenity processes running.
And yes, i don't particularly like tracking apps through pid's to kill them either, but i cant think of any other way to do this.

I do have the latest version of salix-update-notifier and i wonder why i have the problem here.
But, looking at the script, i can see that what i'm facing is indeed possible.

Cheers,
ray
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: Salix Update Notifier - Multiple Notification Icons

Post by damNageHack »

Have you tried my suggestion with pgrep? You should modify the script /usr/bin/salix-update-notifier as described, only one line is affected.
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.
User avatar
ray
Posts: 87
Joined: 20. Mar 2010, 10:28
Location: United Kingdom

Re: Salix Update Notifier - Multiple Notification Icons

Post by ray »

@damNageHack,

The pgrep line you wrote wouldnt work if there's more than one instance of zenity around, would it?
Anyways, i'll have a shot at it tomorrow, it's getting a bit late.

Cheers,
ray
User avatar
damNageHack
Posts: 663
Joined: 24. Sep 2009, 17:07

Re: Salix Update Notifier - Multiple Notification Icons

Post by damNageHack »

Sorry, but I doubt that I understand your problem.
man pgrep wrote: pgrep looks through the currently running processes and lists the pro-
cess IDs which matches the selection criteria to stdout. All the cri-
teria have to match. For example,
[...]
-f The pattern is normally only matched against the process name.
When -f is set, the full command line is used.
ray wrote:The pgrep line you wrote wouldnt work if there's more than one instance of zenity around, would it?
Do you see the pattern "zenity.+salix" in my code? And now, think again. I doubt that there will be more than one process with a command line that matches a pattern with "salix" in it, and you can see from the original script that the call to zenity uses a special "salix" icon file, so the pattern should be unique enough.
Image
This is the oppinion of the author, it does not force you to share and is signed automatically.
You are free to keep them all errors for your own. Linux is the best game I ever played.
Post Reply