I've ported the
wmii X11 window manager to Minix 3. Details of
some of the things I changed are mentioned in my
previous
post on the topic.
To install you'll need to compile from source.
The source is in
minix-wmii-3.1.tar.bz2
(about 52Kb). To compile:
$ bzcat minix-wmii-3.1.tar.bz2 | tar xvf -
$ cd wmii-3.1
$ make
$ su
<...enter root password...>
# make install
You
will need the X11 libraries installed. You should not use the GNU compiler,
rather use the standard Minix 'cc' and 'make'. The installation will 'chmem' the
installed files with reasonable values to run. It's important that you read the
notes about this port and the end of this post!
To use this window
manager, edit your .xsession or .xinitrc file (the setup of these files is
described here).
Remove the current code that runs 'twm' and the other programs and replace with
the single line:
exec wmii
When you next start X11 the wmii 'welcome' note will
appear. You can follow those instructions to get an idea of how to use this
window manager. If you get stuck, pressing 'ALT+ENTER' will open an
xterm.
'wmii' is a very light weight window manager. When you start it
you'll see a status bar at the bottom of the screen and nothing else. Pressing
ALT+ENTER will open an xterm and you'll see that it takes the entire screen. If
you press ALT+ENTER again the screen will split into two with an xterm above and
below. This is what 'wmii' refers to as 'dynamic window layout'.
You need
never drag or layout windows yourself, the window manager will do it for you.
You can create multiple columns, move windows above and below each other, or
across into the other columns. You can switch to a 'stacked' view by pressing
'ALT+s'. Or a maximised view with 'ALT+m'. Or back to the dynamic layout with
'ALT+d'. To change from application to application in a view with the keyboard
use 'ALT+j' or 'ALT+k'.
'wmii' gets really powerfull though when you take
advantage of 'tagging'. You can tag a particular running application with a
number by pressing 'ALT+SHIFT+[0-9]'. This will assign that number as the 'tag'
for the application and move the application to a view for that tag. To change
to a dynamic layout for all apps with that tag press 'ALT+[0-9]'.
This
doesn't give much more than 'workspaces' gives in other window managers. But you
can also assign multiple tags to an application in 'wmii'. And they don't need
to be numbers. So I could have firefox open (running using remote X11 from
another machine) and give it the tag 'browser' and by pressing 'ALT+SHIFT+t' and
typing in 'browser' and pressing enter. Or give it multiple tags by pressing
'ALT+SHIFT+t' and typing in 'browser+2'. This gives it the tags 'browser' and
'2'.
Pressing 'ALT+2' now will take me to that application and so will
pressing 'ALT+t' and typing in 'browser' (or a partial completion). This allows
you to give applications multiple tags, switch to the tag and all applications
with that tag will appear, dynamically layed out by the window manager.
Neat!
It gets even better. 'wmii' exposes a scripting interface via a
Plan 9 based filesystem. If you have
Plan 9, Inferno, or some other OS that supports this filesystem you could mount
it from there and manipulate the display. Since Minix doesn't have 9P support
you can use the tool 'wmiir' which allows you to do this. For example, to get a
directory listing of the root of the virtual filesystem:
wmiir read /
This will display a list of virtual directories which
you can drill down on:
wmiir read /event
This reads all events that occur in 'wmii' and
displays it. You'll see tag switching, focus changes, etc. With this you can
write scripts to react to events. Which is how some of the utilities in 'wmii'
are written - as shell scripts. You can change that status bar with:
echo -n Hello! | wmiir write /bar/status/data
The 'status' script
in /usr/local/etc/wmii-3/status' does this to display the current time and
machine load.
There is much more that can be done and browsing the
wmii web site will go through the various
things.
This is a 'work in progress'. I've had to work around some things
that I'd like to tidy up. Some current limitations are:
- A temporary file is created in /tmp/ that is supposed to have a random
suffix but does not in this version. This is due to the lack of 'mktemp' in
Minix. I'll fix this in the next release.
- The 'tcp' port used for 'wmii' communication is hard coded to port 5000
and is not bound to the IP address of the machine. Anyone can connect to it.
If your machine allows incoming connections on that port you probably don't
want to run to run this version or use a firewall to block that port.
- Sometimes the 'status' script exits due to not being able to connect to
the 'wmii' server. You can restart it by using 'ALT+a' and choosing
'status'.
The first two these issues can be changed by editing the
'wmii' script. You'll see in there where the '5000' port and the filename is
hardcoded. Unfortunately the open access to the socket is in the C source code
as I did that to work around a problem I was having which I hope to resolve in
the next release.
This version is based on the wmii 3.1 source code. The
current development snapshot for wmii is on to version 4. I'll look at porting
that when I've got 3.1 stable. For those interested in hacking at the code I
have a
git
repository here:
git clone http://www.minixtips.com/repos/wmii/.git
If you come
across any other problems or have any suggestions please leave a
comment.
Categories: minix, x11, ports, development