Friday, May 8, 2009

two-column default for wmii-ruby (sort of like xmonad)


How to default to 2 columns in wmii-ruby?


Add this to your wmiirc-config.rb file:

on_createclient do |cid|
tag = read("/client/#{cid}/tags")
# does the last line start with a "1", then only one column
if read("/tag/#{tag}/index").split("\n").last.match(/^1\s+/)
write("/tag/sel/ctl", "send sel right")
end
end

Basically, if you have one column of applications and you open another client, this will shove your client to the right, making a 2nd column. This should work on the wmii 3.5-3.6 series.

This (not going automatically into 2 columns) has bothered me a lot in the past and when I was trying out xmonad I found that they do this in the default layout. [It would be fun to implement the rest of the basic xmonad layouts in wmii-ruby...]

What is wmii-ruby? (in case you're asking)


I've been playing around again with wmii-ruby. wmii is a minimalist window manager for X11 (i.e., graphics on *nix-ish OS's) that is very scriptable and wmii-ruby is (you guessed it) wmii scripted in ruby. Best features:
  1. tiling window manager (use all your screen space)
  2. uses very flexible tagging system to keep things organized.
  3. very scriptable (see above example)
  4. can use a mouse but don't really need to
It really is aimed more at hacker-types than the general public, but it is quite educational figuring out how to do many of the things you take for granted with a more feature rich desktop like gnome or KDE.

No comments: