Results 1 to 2 of 2

Thread: How to update text for python-eggtrayicon

  1. #1
    Join Date
    Feb 2008
    Location
    Atlanta
    Beans
    78
    Distro
    Ubuntu 9.10 Karmic Koala

    How to update text for python-eggtrayicon

    I'm using tint2 for a panel and want to show the cpu temp as a system tray icon since there aren't any plugins for tint2 that do that and I'd just like to know how to do this anyway whether there was one or not. The script I have so far is:
    Code:
    #! /usr/bin/python
    import pygtk,os
    pygtk.require("2.0")
    import gtk
    import egg.trayicon
    t = egg.trayicon.TrayIcon("CPUTemp")
    cpu_temp=os.popen('sensors | grep "temp1:" | cut -d+ -f2 | cut -c1-2').read()
    t.add(gtk.Label(cpu_temp))
    t.show_all()
    gtk.main()
    Basically, it works the first time around but I'd also like it to update every 5 seconds or so. Any help greatly appreciated.
    Windows has and has always had zero TCO, because Microsoft owns it and you never do. You may be charged for the joy of possibly being allowed to use Windows, if you're a good boy or girl. But it's really totally free of ownership costs.

  2. #2
    Join Date
    Feb 2008
    Location
    Atlanta
    Beans
    78
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How to update text for python-eggtrayicon

    I have just about had it. Everytime I try to do anything cool in desktop Linux, I end up beating my head against the no documentation wall. I have scoured the internet all day and can't find a single lick of real documentation for this module. This is utterly ridiculous. Note to any nascent programmers reading this: never get bogged down with undocumented libraries or programming languages. You will experience frustration and unhappiness. /rant
    Last edited by oakgrove; March 6th, 2011 at 05:30 PM.
    Windows has and has always had zero TCO, because Microsoft owns it and you never do. You may be charged for the joy of possibly being allowed to use Windows, if you're a good boy or girl. But it's really totally free of ownership costs.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •