Re: rhn-applet replacement...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Il giorno mar, 13/12/2005 alle 16.06 -0500, Jeff MacDonald ha scritto:
> On Tue, 2005-12-13 at 14:26 +0100, Mario Pascucci wrote:
> > I've installed Fedora Core 4, and I found that rhn-applet alert icon is
> > not working at all.
> > Playing with bash scripting, I've made a very simple script that checks
> > via "sudoed" command 'yum check-update' for updates and display an icon
> > on the Gnome panel "notification area" applet using Zenity.
> > 
> > It's a very poor method, but it works...
> > If someone is interested, I'm happy to share this very simple script.
> > HTH
> > 
> 
> yes, please post to the list with your script.

Ok, it's here.
There are two files, one is the script itself (fedupdatealert), and the
other is the configuration file (fedupdatealert.conf).

It needs: Zenity (from gnome-utils), sudo, yum and
notification-area-applet.

Place the script in the /usr/local/bin, or in the ~/bin if you have only
one user, and the configuration file in the same directory.

Add this line in "sudoers" file:
ALL     ALL=NOPASSWD: /usr/bin/yum check-update

It's needed to run yum with root privileges and without asking a
password. Without privileges, yum cannot download the xml from
repositories and run entirely from cache, so the check isn't useful.

I make the script running with the "Sessions" configuration utility of
Gnome desktop.


Open questions/Known problems:
- a click to the icon closes zenity. The icon will appear in the next
loop og the script.
- when user exits from desktop session, the script is not terminated,
and I don't know what method is the best way to check for this event.
- the script uses a very "dirty" method to detect session ending: if
zenity returns 255, it means that zenity cannot connect to X diplay (no
user logged, or different user logged), and exits.

The script at this moment is under test in my notebook, and it worked
for two days without problems.

Thanks. 

-- 
Mario 'Reliant' Pascucci
http://ilpettegolo.altervista.org/

Attachment: fedupdatealert
Description: application/shellscript

# configuration file Fedora update alert notification icon

# default uses rhn-applet icons
# icon for "ok"
OKico="/usr/share/doc/rhn-applet-2.1.17/figs/applet/applet-okay-48.png"

# icon for "updates available"
UPDico="/usr/share/doc/rhn-applet-2.1.17/figs/applet/applet-critical-48.png"

# icon for "troubles"
WARNico="/usr/share/doc/rhn-applet-2.1.17/figs/applet/applet-error-48.png"

# icon for "check in progress"
WORKico="/usr/share/doc/rhn-applet-2.1.17/figs/applet/applet-busy-48.png"

# interval between two checks (seconds)
INTERVAL=3600

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux