INTRODUCTION
Installation
Check if the package management of your operating system already provides a package for the latest wmii snapshot and install this, or build wmii from scratch after downloading the source. If you build it from scratch, follow the instructions in the shipped README file.
Running wmii
Add the following line to your .xinitrc to start wmii using xinit:
until wmii; do
true
done
In order to connect wmii to a specific display, make sure that
the $DISPLAY environment variable is set correctly. For example:
DISPLAY=:1 wmii
This will start wmii on display :1.
And run xinit afterwards. (Note: make sure wmii is in your $PATH)
Tagging
The classical workspace model conceives the workspace as a(n exclusive) collection of clients, thus you can start clients on each workspace and move them from one workspace to another. The window manager can only show one workspace at time, so to reach your clients you have to switch between workspaces.
Additional operations that are performed in workspaces of classical window managers:
- Hide/Show
- Maximize/Minimize: give/retain all the screen to a client
- Move client to ws: moves a client to a different ws
- Sticky/Non Sticky: makes a client visible in all ws
Tagging is a more general concept that supersedes the classical workspace model.
Here is a brief overview of wmii's tagging model:
- A tag is an alphanumeric string which is associated with one or more clients.
- A view is a set of clients matching a specific tag.
Tagging is defined by the dictionary as: attach a tag or label to something, in this particular case to clients. This way a client belongs to a set of classes.
This way a workspace is not a set of clients but a set of tags. This enables to:
- have clients with one tag (so they only appear in one view exclusively).
- have clients with multiple tags (so they appear in different views, sticky).
tagging in wmii
apply a tag
To tag a client, the desired tag(s) are written to the /client/sel/tags file:
echo -n '1+2'| wmiir write /client/sel/tags
(In this case the currently selected client was applied tags 1 and 2.)
selection
To change the view, the view
echo -n view 1 | wmiir write /ctl
(In this case only client tagged with 1 are viewed.)
tag rules
wmiir write /tagrules <<EOF
/XMMS:.*/ -> ~
/Gimp.*:.*/ -> ~
EOF
(WMII uses the name from the window props ( wmiir read /client/sel/props and wmiir read /tag/sel/index ) )
(This is an excerpt of wmiirc, where the broken clients XMMS and Gimp are moved to the float layer, so they're not managed by wmii.)
Events
Event-based scripting is a very powerful and useful part of wmii. It allows scripts to watch for events generated by user interaction. Anytime you move a window, change focus, click a bar, etc, you generate a specific event, which is written to wmii's internal /event file as a single line with 2-3 fields. To get the feel for it, try executing
; wmiir read /event
in a terminal and generating some events, by changing focus, clicking on titlebars, etc. Once you understand how it works, you can use it in your scripts. Note: for key events, due to the nature of X11, only those keys grabbed by wmii (wmiir read /keys) will generate events. So, when creating a new keybinding in wmiirc, make sure to list it in the write to /keys and the event loop.