Dec 07 2012

enable/disable hibernate/suspend pygtk status icon

Category: pygtkerm @ 12:33 am

Every once in a while my machine runs stuff in the background, like backups, db dumps and whatnot. This obviously causes performance issues at times, but among other things I don’t want to shutdown during these processes.

So I created a simple status icon to warn me if one of those processes were executing so I wouldn’t shutdown the machine, and it also will disable hibernate/suspend.

I figure I’d share it with the world.

Continue reading “enable/disable hibernate/suspend pygtk status icon”


Sep 12 2012

python command line bandwidth monitor

Category: pythonerm @ 8:20 pm

In a previous post I wrote a bandwidth monitory in php. It was running about 300k (on my laptop it was < 100k), and figured it was time to test out my python foo. This version also displays a line similar to this at the top of your terminal window: eth0:RX:600b TX:944b Av:77b eth2:RX:0b TX:0b Av:0b

Usage is simple:
$ ./bw.monitor.py & htop
Continue reading “python command line bandwidth monitor”


Sep 07 2012

python, pygtk crumblist

Category: pygtk,pythonerm @ 10:13 am

I needed a hbox that would automatically take children widgets from one row and put it into another row depending on the width of the widget. This is similar to how html elements are handled on a web page.

The desired result was to basically make a crumb/tag list with a close button that you could easily remove elements from.

Continue reading “python, pygtk crumblist”


May 25 2012

Pygtk star rating cellrenderer for a treeview

Category: pygtk,pythonerm @ 6:12 am

This code is a complete hack. I’ve probably done it wrong in someones eyes out there, and if by chance you are better at this sort of thing, and see room for improvements please pass it along.  I can only stand so much insanity building this thing.  It works for what I need.
Continue reading “Pygtk star rating cellrenderer for a treeview”


Oct 27 2008

reload program after logoff in python/pygtk

Category: gtk,pygtk,pythonerm @ 6:28 pm

This snippit of code will restart/reload your python/pygtk app when you log out so you don’t have to keep restarting it.

import gnome.ui
gnome.program_init('program name', "1.0")
client = gnome.ui.master_client()
command = os.path.normpath(os.path.join(os.getcwd(), sys.argv[0]))
client.set_restart_style(gnome.ui.RESTART_IF_RUNNING)
try: client.set_restart_command([command] + sys.argv[1:])
except TypeError:
	client.set_restart_command(len(sys.argv), [command] + sys.argv[1:])
client.connect('die', gtk.main_quit)

Tags: , , , , ,


Oct 22 2008

TreeView and the frustration

Category: gtk,pygtk,pythonerm @ 3:47 pm

Anyone that’s ever used treeview, might understand my frustration.

I really don’t understand the reasoning behind forcing people to use cellrenders.

Continue reading “TreeView and the frustration”

Tags: , ,