Many plugins also provide parameters that can be modified. For example, the "volume" plugin allows you to specify the mixer used:

Many plugins also provide parameters that can be modified. For example, the "volume" plugin allows you to specify the mixer used:

plugin_config["standard:volume"]["mixer"] = "Headphone"

plugin_config["standard:volume"]["mixer"] = "Headphone"

−

Here, we've set the mixer parameter of the volume plugin in the standard namespace to be "Headphone". These sort of configuration parameters make life a lot easier as users don't need to create custom plugins to modify existing behaviour.

+

Here, we've set the mixer parameter of the volume plugin in the standard namespace to be "Headphone". These sort of configuration parameters make life a lot easier as users do not need to create custom plugins to modify existing behaviour.

This last command will copy the updated ruby-wmii over what you have in ~/.wmii-3. CAUTION: This will overwrite any changes you have in ~/.wmii-3/wmiirc or ~/.wmii-3/standard-plugin.rb. For this reason, you shouldn't edit these files! Rather, make config changes in ~/.wmii-3/wmiirc-config.rb, and if you want to modify a plugin, copy it into a new file under ~/.wmii-3/plugins and make your edits in this file.

ssid

One utility which might not be present on your system is ssid. If you lack this application you will find that the trust Mod-p menu will no longer launch applications. It is a tiny application intended as a replacement for setsid and can be found on the wmii website at [1]. It needs to be built and put somewhere that wmii-ruby can find it.

Personally I prefer not ever to run a make install unless through a PKGBUILD so you can alternatively copy the ssid binary somewhere into your local user's path.

Low level access

The wmiir command can be used to manipulate wmii at a low level; read the manpage for details (although this isn't really necessary for a new user!). Control scripts in different languages can use this command to control wmii. wmii is controlled through a filesystem interface using the 9P2000 protocol, which in turn is derived from the plan 9 operating system. As such, there are also libraries such as ruby-ixp which can be used to manipulate the window manager programmatically over 9P. This is technically faster, as no calling of external programs such as 'wmiir is then needed; however, at the time of writing, ruby-ixp is quite new and isn't used by the ruby-wmii project.

Plugins

ruby-wmii's plugins consist of both bar applets and key bindings. The standard-plugin.rb file provides the following plugins: volume, mode, dict, battery-monitor, mpd, cpuinfo, status. These are mostly self-explanatory, except perhaps mode, which toggles between wmii catching key combos and passing them to programs directly. It also provides a lot of sensible key bindings and actions, such as being able to tag and rename windows with ease (check out this for more information about tagging in wmii).

Bar applets are used by editing ~/.wmii-3/wmiirc-config.rb, and modifying/adding "use_bar_applet" lines. Traditionally, numbers are used to modify the order in which plugins appear in the bar; I personally prefer to specify them thusly:

This will cause mpd (my custom one, listed below, in namespace "nogoma"), cpuinfo, etc. to be included in the bar, in the given order.

Many plugins also provide parameters that can be modified. For example, the "volume" plugin allows you to specify the mixer used:

plugin_config["standard:volume"]["mixer"] = "Headphone"

Here, we've set the mixer parameter of the volume plugin in the standard namespace to be "Headphone". These sort of configuration parameters make life a lot easier as users do not need to create custom plugins to modify existing behaviour.

Bindings

Another aspect of wmii is keybindings; how different key combinations affect the wm. Some plugins define key combos by default when they're used; others define sets of bindings that can be selectively included/excluded in the wmiirc-config.rb. They can be used by including:

use_binding("<binding-name>")

in your wmiirc-config.rb

Basic keybindings can also be made with the on_key command in wmiirc-config.rb:

on_key("MODKEY-LEFT") {
#actions
}

Summary

Don't forget you can leverage most all of the power of Ruby when using this control script; there are a lot more functions and helpers the ruby-wmii project provides. The files are fairly self documenting, and Ruby a fairly sensible and readable language. Don't be afraid to experiment and add new plugins and keybindings!

Arch user contributions

Here are some plugins/snippets from users on the Arch forums.

MPD (modified for use w/ multiple hosts)

I (nogoma) like to be able to control either mpd on my laptop when out and about, or my media pc via my laptop when at home. So, I (trivially) modified the standard mpd plugin to allow me to change hosts. The ruby-wmii is relatively self-documenting about how to define your own plugins; hopefully the below makes sense (it defines a new plugin in the "nogoma" namespace, which contains a bar applet called "mpd". Notice that this new applet doesn't conflict with the mpd applet shipped w/ ruby-wmii, because it is referred to as "nogoma:mpd" instead of "standard:mpd").

This plugin also provides the default keybinding of MODKEY-Control-M for switching hosts. Typing in a new hostname and hitting enter will cause the mpd applet to try connecting to that host. It also exposes two configuration values which can be set: