Detect new upgrades graphically (XFCE and others DE)
Posted: 15. Nov 2009, 22:13
I share here the way I detect when there are updates available.
First install the following packages (avail. on Salix):
- xfce4-genmon-plugin
- libnotify
- ktsuss (already installed normally)
- slapt-get (already installed normally)
- gslapt (already installed normally, and this could be another graphical package manager)
First, create a "bin" folder in your home directory if not already done.
Then create the file SalixCheckUpdates whith exec permission:
Add a "Generic Monitor" plugin in a XFCE panel with the following configuration:
Command : /home/$USER/bin/SalixCheckUpdates
Label : SCU
Period : 600 (every 10 min)
Last, in superuser, create the following file:
You're done !
Here is two screenshots:


First install the following packages (avail. on Salix):
- xfce4-genmon-plugin
- libnotify
- ktsuss (already installed normally)
- slapt-get (already installed normally)
- gslapt (already installed normally, and this could be another graphical package manager)
First, create a "bin" folder in your home directory if not already done.
Then create the file SalixCheckUpdates whith exec permission:
Code: Select all
$ cat <<'EOF' > ~/bin/SalixCheckUpdates
#!/bin/sh
CFG=~/.config/SalixCheckUpdates
if [ ! -e $CFG ]; then
mkdir -p $CFG
fi
CHECKCMD=$(cat $CFG/check_command 2>/dev/null || echo "PKGS=(\$(/usr/sbin/slapt-get -s --upgrade|grep '^ ')) ; echo \${#PKGS[@]}")
N=$(bash -c "$CHECKCMD")
PKGM=$(cat $CFG/package_manager 2>/dev/null || echo gslapt)
if [ $N == 0 ]; then
echo "<img>/usr/share/icons/gnome-colors-common/24x24/status/updates-notifier-inactive.png</img><click>gksu $PKGM</click>"
else
echo "<img>/usr/share/icons/gnome-colors-common/24x24/status/updates-notifier.png</img><click>gksu $PKGM</click><tool>$N updates !</tool>"
C=0
if [ -r $CFG/count ]; then
C=$(cat $CFG/count)
fi
if [ "$C" != "$N" ]; then
notify-send 'Salix Check Updates' "$N packages to upgrade !"
fi
fi
echo $CHECKCMD > $CFG/check_command
echo $PKGM > $CFG/package_manager
echo $N > $CFG/count
EOF
$ chmod +x ~/bin/SalixCheckUpdates
Command : /home/$USER/bin/SalixCheckUpdates
Label : SCU
Period : 600 (every 10 min)
Last, in superuser, create the following file:
Code: Select all
# cat <<'EOF' > /etc/cron.hourly/slaptget
#!/bin/sh
ionice -c3 nice -n 19 /usr/sbin/slapt-get -u
EOF
Here is two screenshots:

