Categories
Computers

uzbl Scripts

I’ve worked up some python scripts for working with uzbl. They are available for download from here. They are both wxWidgets programs.

The first one, wxuzblAbar.py, is an address bar of sorts for a uzbl instance. It can be bound to a key press with something like the following in the uzbl config file:

 bind     a  = spawn $XDG_CONFIG_HOME/uzbl/wxuzblAbar.py

When launched, it has a text field to enter an address as well as a drop down list for favorite links. In order for that to be useful a file name “favorites” needs to be added to $XDG_DATA_HOME/uzbl. The file format consists of two double-quoted text fields separated by spaces:

"Mutt"     "www.mutt.org"

The other file, addFavorites.py, actually makes the “favorites” file that the first script uses. Bind it to a key like this:

bind      f   = spawn $XDG_CONFIG_HOME/uzbl/addFavorites.py

When the key is pressed, a text box will appear allowing the name to be edited. The next time the address bar is invoked the new link will be in the drop down list.

At this point the only dependency, I think, is socat which is required for wxuzblAbar.py to work. Also, the wxWidgets libraries might come in handy.

One limitation of the address bar program is that is must be launched for each instance. Based on the way uzbl created sockets, it might be possible to scan for all opened uzbl sockets and put them in a list so that a single address bar instance can control multiple uzbl instances. Of course, that might be a bit kludgy from UI perspective, but it’s something to try. Something else that might be more useful is a dropdown list for a history of links. I’m just not sure what would be involved with parsing the history file.

Leave a Reply

Your email address will not be published. Required fields are marked *