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.
I think this should do what you're trying to achieve:
- Code: Select all
if [[ `LANG=C /usr/sbin/slapt-get -s --upgrade | grep "Need to get"` ]]
if [ -n "$TRAYPID" ]; then
kill "$TRAYPID" >/dev/null 2>&1
kill -9 "$TRAYPID" >/dev/null 2>&1
zenity --notification \
--text="`eval_gettext 'Package updates are available.'`" \
if [ $ret ]; then
zenity --question \
--title "`eval_gettext 'Install package updates?'`" \
--text="`eval_gettext 'Package updates are available for your system.\n\nSelecting OK will perform the updates using gslapt. Root user privileges will be required in order to do that.\n\nProceed with updating?'`" \
&& $SUCOMMAND gslapt --upgrade
But I don't think that this is the problem. Already in the original version execution would only continue when zenity --notification returns. So pretty much the only scenario, when I could imagine multiple icons would show, requires multiple instances of salix-update-notifier running. Can you check that when anybody experiences this issue again. Something like ps -A | grep salix
If that's the problem, I guess some kind of locking should be added to salix-update-notifier to prevent that kind of conditions.