eigenclass logo
MAIN  Index  Search  Changes  PageRank  Login

ruby-wmii 0.3.1: bookmark manager, generalized menus, view history...

I just released ruby-wmii 0.3.1. If you didn't know it, it's a Ruby script plus associated plugins to control the wmii window manager.

The most important (and heaviest) change in 0.3.1 is the inclusion of the bookmark manager I wrote about earlier. It can import and sync your bookmarks against del.icio.us, is keypress by keypress the most efficient bookmark manager out there, and allows complex queries. It supports regular expressions on both titles and URLs, progressive refining, temporal expressions... For instance, you can open all the articles with the redhanded tag, including 'wmii' in either the title or the URL, bookmarked/visited in the last 2 months with

 :redhanded wmii ~d <2m

If you already had ruby-wmii installed, you can enable the bookmark manager by adding something like this to your ~/.wmii-3/wmiirc-config.rb:

from "standard" do
  use_binding "bookmark"      # , "MODKEY-Shift-b" # uncomment and change to
  use_binding "bookmark-open" # , "MODKEY-b"       # override the default keys
plugin_config["standard:bookmark"]["del.icio.us-user"] = 'myusername'
plugin_config["standard:bookmark"]["del.icio.us-password"] = 'mypass'

I've also added recently an experimental binding to move across the view history, using MODKEY-plus (forward) and MODKEY-minus (backwards) by default. I've been using it for a few days and it seems to complement MODKEY-r (move to previous view, cycles over the last 2 views) nicely. Here's the incantation:

from "standard" do
    use_binding "history-move-forward"
    use_binding "history-move-back"

ruby-wmii 0.3.1 also includes a few additional features and a number of bugfixes.


I've created a couple editable nodes on eigenclass.org you can use to find and share configurations, plugins, tips, etc:


The latest version of ruby-wmii is available here.

Changes since 0.3.0 (2006-07-04)


  • ability to add arbitrary data sources to the program menu list by adding some code in your config file.
  • bookmark manager applet
  • support for multiple mixers in the volume applet
  • view history (history-move-forward and history-move-back bindings)


  • fixed the 'screenshot' internal action
  • wmiirc exits properly when the "quit" internal action is executed, and detects when wmiiwm died
  • critical/low battery notifications aren't shown repeatedly anymore


  • standard:status now uses plugin_config["standard:status"]["refresh_period"] instead of plugin_config["standard:status"]["refresh_time"]
  • LOGGER.level set to INFO by default; you can override that in wmiirc-config.rb

Plugin API changes

  • Removed WMII::Configuration#program_list
  • Added BarButton#colors, #fgcolor, #bgcolor, #bordercolor and their respective setters
  • each plugin is loaded in an anonymous module


Wael Nasreddine

  • suggested several improvements in the standard plugin functionality

Jeff Mickey

  • contributed battery-monitor and mpd

Nathan Howell

  • generalized program lists, so that additional "smart" sublists can be defined in wmiirc-config.rb.

Tom Lieber

  • added support for multiple mixers to the volume applet

Constantine Evans

  • reported bug in battery-monitor (repeated actions/notifications)

how to launch wmii on Mac OS X - paul (2006-10-22 (Son) 04:03:21)

Just in case someone overlooked this alternative on Mac OS X: In addition to "startx" you can launch wmii by using "open-x11 wmii" which is much faster. Another option seems to be the use of "quartz-wm --only-proxy &" in $HOME/.xinitrc (but I haven't explored that option yet).

system() - Constantine Evans (2006-09-20 (Wed) 13:59:10)

I don't particularly like the overuse of system "cmd args &" to spawn commands. This starts a /bin/sh every time you use it. It would probably be better to define a function like def frun(cmd); Process.fork {a = cmd.split; exec cmd[0],*cmd[1..-1]}; end and then use in some of the cases. I am thinking about writing a replacement for system that runs entirely in ruby and can still do basic redirection, etc, in which case many of the system instances could be replaced with that. But I am not sure how much of a performance gain this causes.

mfp 2006-09-20 (Wed) 15:39:58

I saw this in wmii's ML and it does indeed sound good. I'll be replacing some #system calls in head. Thanks.

some suggestions - Dmitry (2006-09-08 (Fri) 09:35:06)


Thanks for the great work! ruby-wmii rocks!

Modifications I've made for myself:

1. Extend letter-jump to '0'..'9' keys.

2. letter-retag binding (like numeric-retag).

The bookmark system is very nice. But how can I delete or change existing bookmark (without editing bookmarks.txt by hand)? I think I'll implement this for myself soon and can send a patch if you want.

Also syncronization with del.icio.us works strange. As I understand bookmarks are not uploaded but only downloaded. If you create a bookmark on the site than update bookmarks, edit the bookmark on the site and update again, you get 2 separate bookmarks. I think all new or modified bookmarks should be uploaded to the server and on update all local bookmarks are removed. But I do not know if del.icio.us allows such usage. Does each bookmark has unique id and date? May be I'll dig into it myself later. What do you think of this?

There is a problem with encodings in bookmarks. I have KOI8-R locale and del.icio.us bookmarks are in UTF-8 (I think) and displayed incorrectly.

Thanks for your work!

mfp 2006-09-09 (Sat) 04:20:28

I'm glad you like ruby-wmii :) Your modifications sound good; I'll be happy to merge them into HEAD if you want (letter-retag sounds great).

As for how to edit the bookmarks, I thought that just editing bookmarks.txt would be the easiest way, and that's one of the reasons why sync only worked in one direction: otherwise I'd have to detect manual changes.

The other reason is that I didn't know if del.icio.us exposed any mechanism to modify bookmarks. Well, I've just read the API docs again and it turns out that the URL is the UID :) and you can replace an entry by setting replace=yes.

I'm going to give this a try and see if I can get it implemented before lunch :-)

Regarding the charset issues you're experiencing: does wmiimenu work at all with KOI8-R? I thought it had troubles with most non-ASCII text. I guess it does work, if you wrote that, so I'll try to add some Iconv magic to do UTF-8 -> charset of choice.

Dmitry 2006-09-09 (Sat) 12:33:21

Yes. wmiimenu works fine with KOI8-R. If I create a bookmark using ruby-wmii it title is in KOI8-R and is displayed correctly. This is another sync issue. I guess the best way is to store bookmarks in UTF-8 and convert them to locale on the fly. But may be bot...

Actually I've played with bookmarks a little bit. And here it is what I have now.

I've disabled sync with del.icio.us for now.

Than I've changed the behavior of add_bookmark to replace bookmarks with the same URL.

Removed the merge! function. So save! actually just save the current state.

Added delete-bookmark and edit-bookmark actions. Edit allows to change title and tags.

So I really like it now. I can work with bookmarks just using wmii.

Also I've changed add-bookmark to work with any URL (actually any text within the buffer), but to get title for http. And if getting title fails it continues to work. I think this is very useful as allows to bookmark ftp/https and http wich require authentication.

I will send you the changes.

mfp 2006-09-09 (Sat) 13:38:27

Great! I've implemented real (bidirectional) sync'ing with del.icio.us. I'll push it to the online darcs repository in a while.

Charset conversion before displaying with wmiimenu, as you suggest, seems the easiest way to handle encoding problems due to the way I sync against del.icio.us.

Looking forward to your patch, I'll merge it ASAP.

chmod +x ~/.wmii-3/wmiirc - Alex (2006-08-27 (Sun) 11:30:31)

I've just spent much too long trying to work out why I'm not getting any ruby-wmii goodness after running ruby install.rb. I guess I'm the first one to forget to chmod +x the wmiirc, but couldn't the install script do this automatically, or at least a note be added to the installation documentation?

mfp 2006-08-27 (Sun) 13:36:25

Sorry, I hadn't realized that the permissions in the tarball were not correct (since they were OK in my working directory).

Simon Arnaud reported this a couple weeks ago and I've pushed his patch to the darcs repository at http://eigenclass.org/repos/ruby-wmii/head

Various Observations - Constantine Evans (2006-08-15 (Tue) 03:57:36)

For some reason, on a relatively clean Ubuntu Dapper installation, the last keybinding in the default config (Ctrl-MOD1-Right) causes X to kill wmiiwm. Unfortunately I don't have the error message right now - it was something about trying to access something private.

The bookmarks manager is quite promising, but it would be more useful to me if it were generalised past the current restriction of only bookmarking websites. The system could be expanded to bookmark quite a few different types of things. It would be great if I were able to use the bookmark manager to access the PDFs of papers I have. In a way, this would make the system serve as a much simpler replacement for beagle/tracker/etc. I'm not sure of the best way to do this - whether it would be better to write support for each format, or to have a more general command form for the bookmarks, with each bookmark specifying a command to be run. The latter would seem rather easy to do, and would allow quite interesting functionality.

mfp 2006-08-15 (Tue) 04:54:21

Do you think wmiimenu would be up to the task? This sounds very interesting, but I'm not sure

  • wmiimenu is the right interface (some sort of preview window seems desirable)
  • we could pipe all the info to wmiimenu quickly enough
  • linear search would be fast enough if we add more items. While I can have at most a few hundred (thousands, if you bm compulsively) bookmarks, I could have many many more indexable things if I also consider PDFs and stuff.

At any rate, full-content searching is a no-no, wmiimenu won't do past titles+tags+attributes.

olli 2006-08-26 (Sam) 16:15:53

First, I'd like to thank you for the ruby-wmii-script. Today I tried your bookmark-manager, and I like it. But I was wondering if it's possible to add tags to a bookmark without entering the description manually, so e.g. for this page pressing `Modkey-b', then selecting one of the proposed descriptions and then adding the tags. When I start typing, I lose my former selection. It should be possible to append it.

mfp 2006-08-26 (Sat) 17:16:49

It's possible (I do it all the time). You have to expand the current selection by pressing TAB, and then type the tags. For instance, to bookmark this page you'd do (assuming MODKEY = Alt)

Shift-Alt-B TAB SPACE :ruby CR

You can add as many tags as you want, e.g.

Shift-Alt-B TAB SPACE :ruby SPACE :wmii SPACE :eigenclass CR

wmii's developers must have put a lot of thought into wmiimenu; it's got by far the best auto-completion mechanism I've seen, usability-wise (for me, at least).

exploring - trans (2006-08-14 (Mon) 06:24:17)

I played around with wmii and in principle I like it. But it still seems rough around the edges. For instance Kate doesn't seem to work exactly right with wmii. I think it may *overly* ignore the mouse too. Simple example: having to hold down a key to resize or move a floating pane seems a bit much --I would think edge detection would really work just fine here.

Anyway, all that aside, I would be inclined to continue trying wmii if it weren't for one glaring issue: the lack of anti-aliasing. The fonts just look aweful. It may seem shallow but it really bugs me. Is there a way to fix this?

mfp 2006-08-15 (Tue) 04:46:56

wmii used to do edge detection, but it was dropped in wmii-3. I also missed it for a while but now I miss ALT+dragging when I can't use wmii. Resizing seems painful in comparison when I'm on OSX.

There's no AA support AFAIK, and I wouldn't hold my breath for it. The wmii devels do not want to link against xft (it is deemed a piece of crap, just like 99.9% of the software in existence).