|
|
Subscribe / Log in / New account

Uzbl: a browser following the UNIX philosophy

July 15, 2009

This article was contributed by Koen Vervloesem

Over time, a great deal of functionality has been added to web browsers—extensions, download managers, PDF handling, and the like. This has caused some to become dissatisfied, fondly remembering when a browser was just a browser. Over the last few months, a new project, Uzbl (pronounced "usable"), has come along to create a browser that follows the [Uzbl Logo] UNIX philosophy: "Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface." The result is a refreshingly different browser, which has a minimal graphical interface, has minimal functionality and is controllable through external shell scripts with customizable key bindings.

Uzbl was born during a discussion about browsers in the Arch Linux user forum. At one point Dieter Plaetinck, a Belgian software developer and Arch Linux release engineer, voiced his opinion in the discussion:

I really like the unix philosophy, and I like simple storage backends which you can easily version/merge/synchronize. (eg plaintext). I was thinking about a browser we could write with these principles.

Other participants were excited by the idea and asked if he was really planning to write such a program. After an initial hesitation ("Maybe, if I find the time") and a promising experiment ("well I have been playing a bit with gtk and webkit. you may see some code online soon.. or maybe not"), Plaetinck released the first code on April 21.

In the next couple of days, other Arch Linux users jumped on the bandwagon. They were all dissatisfied with current web browsers, because these are frequent violators of the Unix philosophy. Browsers integrate too many things such as management tools for bookmarks, history and downloads, decreasing the options for the user to handle them the way they want. Current browsers also store data in too-fancy file formats, such as XML, RDF and SQLite, making the data hard to reuse in other scripts. Plaetinck and his Arch fellows decided to change this, and he explains in the FAQ why he invented another browser:

We did try a lot of browsers, and we do not suffer NIH. We believe that the approach taken by way too many browsers is wrong. We do not want browsers that try to do everything, instead we prefer a system where different applications work together, which gives plenty of advantages. We also like open source. We take a lot of things from other projects and we also try to contribute to other projects.

Uzbl follows the UNIX philosophy in the following aspects:

  • It has a minimal graphical interface. Users only see what they need: the webpage and little else.
  • It has minimal functionality. Tasks that are not central to browsing are not in Uzbl. The user has to handle things like bookmarks, URI changing, history, downloads, etc. through external shell scripts.
  • It is controllable through various means: the keyboard, stdin, pipes and socket files, etc.
  • It has a highly customizable keyboard-centric input with support for modes, modkeys, variables and the like. As a consequence, the interface can be tweaked to be vim-like, emacs-like or any other scheme the user wishes.
  • All data and configuration files are written in plain text.
[Uzbl]

Uzbl uses WebKit as the browser engine. This means that the user doesn't have to worry about Flash, JavaScript and all modern web standards: WebKit takes care of all this support (including Flash if the user has installed a Flash plugin such as Gnash or Adobe's) and even has a 100/100 score on the Acid3 test page.

Applications that follow the UNIX philosophy may require a fair amount of configuration in order to get them to a usable state; a large amount of that will impact the application's adoption. Your author installed Uzbl to put this to the test. There is no official release yet, but an alpha version can be downloaded for many distributions, and Arch Linux (which is the main development platform for Uzbl) has a PKGBUILD file. The adventurous user can pull the code from git and build Uzbl from source.

A freshly installed Uzbl includes fairly limited settings and is actually rather unusable. There is no status bar, the program has no key bindings, no handlers for the history or downloads, no buttons for navigation, and so on. The user can't even type anything into forms. However, there's a much more usable configuration file in the examples directory. Copy it to $XDG_CONFIG_HOME/uzbl/config (which expands to ~/.config/uzbl on most systems) and start Uzbl again, after which it really becomes usable, with a status bar and vim-like key bindings. Just as in vim, the user starts in command mode. Typing 'b' goes back, 'ZZ' quits the browser, etc. Typing something in a form can be done by first switching to insert mode ('i').

This UNIX-like rethinking of the interface has another strange consequence: Uzbl doesn't have the concept of a location bar. All changes to the currently loaded URI happen outside of the browser. So the user can't edit the current URI, can't load a URI from bookmarks, and so on. Uzbl comes with some example scripts that use dmenu to pick a URI from a history or bookmarks file. Just copy the scripts subdirectory in the examples directory to ~/.config/uzbl and read the example config file for the key bindings to activate the scripts. Users are even able to bind JavaScript code to a key.

While all other mainstream browsers support tabs, Uzbl doesn't like the concept and sticks to the "one page per instance" principle. Each instance of Uzbl is in essence just a small wrapper around WebKit. Although this will be a showstopper for a lot of people, there is some truth in the philosophy that multiple instances should be handled outside of the browser. In their FAQ, the developers point out that tabbing is something that can be handled by many window managers, such as xmonad and wmii. Another solution is to embed Uzbl instances in other Gtk applications, something that uzbl_tabbed.py has done, a Python script that made it into the example scripts of Uzbl. But the fact that Uzbl is focused on one page per instance means that everyone can write their own custom script for multiple instances management.

An active community

Although Uzbl is only a couple of months old, it already has a fairly active community, with a mailing list and an IRC channel (#uzbl on the Freenode network). The website also has a lot of information for users or developers that want to contribute. The wiki has a lot of community-provided information, such as configuration files, scripts for various tasks and screenshots. Browsing through all this, it becomes clear how powerful the UNIX philosophy is for a browser. For example, writing a script to send a link of the current web page to Twitter or to bookmark it to Delicious is dead simple.

According to Plaetinck, the project has 6 main developers and 28 contributors. Most of the contributors work on the core, programming in C. Surprisingly, Plaetinck himself is not that much of a coder:

Right now I hardly code anything myself for Uzbl. I just merge in other people's code, ponder a lot, and lead the discussions. This project leader role fits me better then a "code contributor" role. This is also why the initial announcement on the Arch Linux forums contained a lot of thought, but the code I showed was only a slightly modified version of the example application from the WebKit Gtk+ website.

There were lots of contributions right from the start. In April there were 28 commits per day, and every evening when Plaetinck came home from work he did nothing but merge code. The project also seems to attract a diverse group of people:

I've seen quite some Ubuntu and Debian people, many Arch and Gentoo users, several people who use BSD and a few who swear by Plan 9. Remarkably, I haven't seen anyone using RPM-based distributions like Fedora, Red Hat or openSUSE.

As interesting as the project may be, there are still some issues, and these are grave enough that Plaetinck doesn't eat his own dog food yet:

I'm not using Uzbl yet as my main browser. The primary reason is that cookies don't work yet as it should. For example, at the moment we spawn a Python process for each HTTP request to check if we have to send a cookie. This makes the browser slow if the cookie handler is enabled. But we're working on a daemonized cookie script we can communicate with through a socket.

In the longer term, the Uzbl developers have a lot of plans:

We have a proof of concept browser now, but the next things we want will take a lot of time and work. We are thinking about better configuration handling, but this can be done in many different ways. Some people want a simple FIFO/socket interface, others prefer a file system interface like wmii has. And other users even want a full blown scripting language like JavaScript for maximum flexibility. We are thinking about what we want and how to implement it.

Plaetinck says he also wants, in the long term, to split the browser into a rendering component and an interface component to help reusability. The key bindings should be improved too: at the moment users cannot bind the arrow keys, function keys, caps lock or mouse buttons.

For whom is Uzbl usable?

For users who find themselves regularly trying to optimize their "digital workspace", Uzbl is definitely a browser to consider, as Plaetinck explains: "I noticed that the best tools to solve my problems are the ones who are merely building blocks that allow me to implement my own methods." After swapping out bloated programs and replacing them by elegant, more UNIX-like programs, Plaetinck found out that pretty much all software for guys like him was out there: window managers like dwm and wmii of the suckless project, editors such as Vim, program launchers such as Bashrun, media players such as MPlayer and MPD, mail clients such as Mutt or Claws Mail, and so on. But until now, there was no web browser in the same spirit. Even "lightweight" browsers such as Midori or Lynx still do too much themselves and don't integrate well with their environment.

Your author is sympathetic to the idea of a browser following the UNIX philosophy, although that may be swimming against the stream. The core is simple and much less crash-prone than a complex browser with all kinds of management tools. And the developers are right to aim for a clean browser with all management tools outside. This makes it possible to adapt the browser to your own workflow and get a significant efficiency boost.

The end result is a lot more "usable" browsing experience. However, this comes with a significant price: a lot of custom scripting. This suggests that Uzbl will only appeal to people who have a very specific workflow, who are not satisfied with the behavior of current browsers, who like to memorize key bindings and who are not afraid of spending hours configuring their browser. Uzbl users should be confident to work with tools such as grep, awk, dmenu, zenity, wget and gnupg to build their own browser behavior. Users who want a browser that does everything and does it out-of-the-box, or who are addicted to a lot of Firefox extensions, will not like Uzbl. But then, looking at the speed of development of Uzbl (it's not even three months old), your author wouldn't be surprised if in one year the browser has an extensive set of helper scripts that can do many of the tasks that Firefox extensions do.


Index entries for this article
GuestArticlesVervloesem, Koen


to post comments

Uzbl: a browser following the UNIX philosophy

Posted Jul 16, 2009 2:48 UTC (Thu) by felixfix (subscriber, #242) [Link]

I'll be watching this, sounds promising. It sends tingly thoughts in and out of my brain.

Uzbl: a browser following the UNIX philosophy

Posted Jul 16, 2009 11:18 UTC (Thu) by mjthayer (guest, #39183) [Link]

The idea sounds very good - componentise the browser so that you can work on each bit individually and mix and match. But that is actually what webkit did I beleive, and uzbl looks essentially like a webkit wrapper. Not sure how well the unix idea of text streams in and out applies to GUI components though. I think that other patterns may be needed here, like the gedit plugin model. Still, I would love to see other big GUI things - specifically an office suite - which were entirely based on small clean components.

Truth about extensions

Posted Jul 16, 2009 17:24 UTC (Thu) by pspinler (subscriber, #2922) [Link]

Some considerable truth about being addicted to extensions. I'm not moving off firefox until I can replicate the functionality of adblock + noscript + betterprivacy + imglikeopera. Also, using window managers for tabbed browsing may not be as easily accomplished on a non-linux system, like my main Mac desktop.

That said, it sounds like adding adblock/noscript like content filters are just a matter of programming.

-- Pat

Uzbl: a browser following the UNIX philosophy

Posted Jul 16, 2009 20:07 UTC (Thu) by jlokier (guest, #52227) [Link] (5 responses)

While it might not replace Firefox as a general purpose browser (for me), it looks absolutely brilliant as an alternative to Gtk/QT for writing GUI applications - using a web front end that runs locally in a self-contained window.

Uzbl: a browser following the UNIX philosophy

Posted Jul 20, 2009 15:07 UTC (Mon) by alex (subscriber, #1355) [Link] (4 responses)

I wonder how it differs from Mozilla's Prism (rendering engine aside). It sounds like the two might accomplish similar goals.

Uzbl: a browser following the UNIX philosophy

Posted Jul 24, 2009 12:39 UTC (Fri) by dmag (guest, #17775) [Link] (3 responses)

Prism is a small step in that direction. You can turn off the menubars and make a webpage look like an app. But Prism doesn't play well with UNIX: from the command line, you can start it and stop it, not much else.

Uzbl sounds like you'll be able to do neat things: (haven't looked at it, but here's my imagination:) log your clickstream to STDOUT, filter URLs clicked on with a shell script (ad-block implemented in perl regexes), re-implement greasemonkey with "perl -pe 's/foo/bar/g'", etc.

As an aside: I can't use the web without Mozilla's keywords: "g foo" does a google search for foo, "w foo" does a wikipedia search, "imdb foo" does an IMDB lookup, "to foo" uses google maps to tell me how far a way a city is, etc.)

Uzbl: a browser following the UNIX philosophy

Posted Jul 24, 2009 20:39 UTC (Fri) by nix (subscriber, #2304) [Link]

You might like 'surfraw'. It's sort of like Mozilla's keywords /
Konqeror's web shortcuts, only from the command line :)

Uzbl: a browser following the UNIX philosophy

Posted Dec 15, 2011 22:28 UTC (Thu) by dashesy (guest, #74652) [Link] (1 responses)

Duckduckgo (DDG) has many many !Bangs for all that keywords, !w for Wiki, !g for Google and \ if you are feeling lucky. If you have DDG in your search bar, you can do that in any browser.

Uzbl: a browser following the UNIX philosophy

Posted Dec 15, 2011 23:12 UTC (Thu) by mathstuf (subscriber, #69389) [Link]

For uzbl at least, I've gathered quite a few nifty shortcuts[1] (the most common as plain bindings, the less used ones with a leading '\').

[1]http://git.benboeckel.net/dotfiles.git/tree/dotfiles/base...

Uzbl: a browser following the UNIX philosophy

Posted Jul 17, 2009 5:42 UTC (Fri) by flewellyn (subscriber, #5047) [Link]

Intriguing idea. I like the concept. I may give it a try when they polish it up a bit more and provide more "usable" defaults.

Uzbl: a browser following the UNIX philosophy

Posted Jul 19, 2009 11:25 UTC (Sun) by sstein (guest, #15028) [Link]

There is a good Firefox extension called vimperator, which gives you a vim-like interface to Firefox. You can define keybindings and hide all menus. Might be an alternative if you don't want to switch your browser, but just become a little bit more efficient in using it.

http://vimperator.org/trac/wiki/Vimperator


Copyright © 2009, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds