SCIENTIFIC-LINUX-USERS Archives

December 2011

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Todd And Margo Chester <[log in to unmask]>
Reply To:
Todd And Margo Chester <[log in to unmask]>
Date:
Sat, 3 Dec 2011 17:12:00 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (78 lines)
> Hi All,
>
> Anyone have a favorite way of displaying when YUM updates
> are available on SL 6.1?
>
> Under CentOS 5.7, Xfce 4.4.2, I used a panel applet called:
>
>      /usr/bin/python -tt /usr/bin/puplet
>
> Now that I have install SL 6.1, "pup" and even "yumex" seem
> to have disappeared.
>
> -T

Frank over at the Fedora-Xfce group gave me a script which I
embellished on.

There is a plugin for Xfce called "Generic Monitor" that I
plugged the script in to.  Works well.

Thank you all for the tips and advice!

-T

My email client clips sentences that are too long, so anyone
using this will have to joins lines where they got clipped,
Note the dependencies in the comments:


$cat genmon-yum.sh
#!/bin/bash

# Reference: 
http://lists.fedoraproject.org/pipermail/xfce/2011-November/000841.html

# From "man yum"
#    check-update
#        Implemented  so  you  could know if your machine had any updates
#        that needed to be  applied  without  running  it  interactively.
#        Returns exit value of 100 if there are packages available for an
#        update. Also returns a list of the packages  to  be  updated  in
#        list  format. Returns 0 if no packages are available for update.
#        Returns 1 if an error occurred.

# Dependencies:  Oxygen icons
#                gpk-update-viewer  (yum install gnome-packagekit)

updates=$( yum check-update -q )
status=$?

if [ $status = 100 ]
    then
       echo -e 
"<img>/usr/share/icons/oxygen/22x22/emblems/emblem-important.png</img>"
       echo -e "<tool>Updates Available</tool>"
       echo -e "<click>gpk-update-viewer</click>"

elif [ $status = 1 ]
    then
       echo -e 
"<img>/usr/share/icons/oxygen/22x22/status/script-error.png</img>"
       echo -e "<tool>the script returned an error</tool>"
       echo -e "<click>gpk-update-viewer</click>"

elif [ $status = 0 ]
    then
       echo -e 
"<img>/usr/share/icons/oxygen/22x22/actions/dialog-ok.png</img>"
       echo -e "<tool>all updates applied</tool>"
       echo -e "<click>gpk-update-viewer</click>"

else
       echo -e 
"<img>/usr/share/icons/oxygen/22x22/actions/dialog-cancel.png</img>"
       echo -e "<tool>status is unknown</tool>"
       echo -e "<click>gpk-update-viewer</click>"
fi

ATOM RSS1 RSS2