ruby-wmii configuration and plugins ("community")
Plugins
Yes, some people actually use ruby-wmii and have written plugins for it 🙂 Several applets in the standard distribution were contributed by others, but there are a few other external resources you might find of interest:
- several plugins by Nathan Howell:
- support for .desktop files from Gnome, KDE, ROX, XFCE in the program menu
- listing of connectable ssh hosts in the program menu
- pushing/pulling selected client from/to current view
- menu-based music controller supporting:
- totem
- banshee
- rhythmbox
- beep-media-player
- mpc/mpd
- squeezebox
- FreeBSD status bar and xmms control by Andy Gimblett.
- A mail plugin written by _why, on redhanded.
- A few wmii3 hacks, also by _why
- a simple plugin to execute yubnub commands (also see www.yubnub.org), by Thomas Neumann
- a simple plugin to show system events in statusbar, with examples on how to integrate it with micq, remind and procmail, by Hannes Schulz
- feel free to complete this list (I know of half a dozen plugins out there, but don’t have the links handy atm. — mfp)
Configuration
you can share your snippets here
Intelligent client retagging
I messed around with wmiirc-config.rb to get it to auto-tag some of my clients (like the default browser-tagged-as-web bit). I wrote about it here: on my blog, but here’s the code snip:
# these are tags for particular apps that I want to have
# new tags - note, they won't get appended to their current tag
tag_for_apps = {
"irc" => "Xchat",
"gaim" => "Gaim",
"web" => "Firefox",
"4-jedit" => "jedit"
}
# these are terminals that I've given specific titles to
# so they can be tagged
tag_for_named_terms = {
"2-consoles" => "console:",
"3-logs" => "log:",
"1-terms" => "term:"
}
# now when a new client comes up, check for an autotag
on_createclient do |cid|
LOGGER.info "checking for autotag on class: #{read("/client/#{cid}/class")} " +
"and name: #{read("/client/#{cid}/name")} "
# if this client is a terminal, check the 'name'
if /terminal/ =~ read("/client/#{cid}/class")
tag_for_named_terms.each do |tfn|
names_re = /#{tfn[1]}/
if names_re =~ read("/client/#{cid}/name")
write("/client/#{cid}/tags", tfn[0])
LOGGER.info " ... autotag'd #{tfn[1]} with #{tfn[0]}!"
end
end
# not a terminal, so go by the 'class'
else
tag_for_apps.each do |tfa|
apps_re = /#{tfa[1]}/
if apps_re =~ read("/client/#{cid}/class")
write("/client/#{cid}/tags", tfa[0])
LOGGER.info " ... autotag'd #{tfa[1]} with #{tfa[0]}!"
end
end
end
end
# ... rest of wmiirc-config.rb
As I mentioned in my blog post, I wonder if this would be a candidate for a plugin. I had a tough time figuring out how to go about setting it up as a plugin, however, so I’d love to hear any hints.
Edit: it’s been pointed out to me that the ‘rules’ at the start of the wmiirc-config.rb can be used as an easier method of autotagging. I had not realized this, and I guess the only advantage to using my example is if for some reason you want a little more control, as with the way I ‘title’ my terminal windows and then tag them by parts of their titles by looking at /client/n/name. I don’t know if ‘rules’ looks at /client/n/class or name, though…
– Jason L

Keyword(s):[ruby] [wmii] [contrib]
References:[ruby-wmii: Ruby configuration/scripting for the wmii window manager] [Extending the wmii WM with more plugins; thanks, Nathan] [Opening up my hiki wiki: bliki.rb plugin] [ruby-wmii 0.3.1: bookmark manager, generalized menus, view history…]