wmii Window Manager for Minix 3
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:
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:
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:
This will display a list of virtual directories which you can drill down on:
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:
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:
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:
If you come across any other problems or have any suggestions please leave a comment.
Categories: minix, x11, ports, development
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

1 Comments:
Hi Chris,
Because of your great job that you've done so far, I could become a fan of Minix. I really appreciated all your contributions.
I hope this comment helps other people who want to try other windows managers. Thanks.
Using JWM 1.7 on Minix 3
Written by Alex D. B. Kim
Tuesday, 31 October 2006
I failed to install Fluxbox and Blackbox. With my narrow knowledge on porting things, I couldn't install them but I don't give up. One day I will install at least Fluxbox on the Minix 3 machine. Fortunately, I realized that there is a windows manager "JWM" included in the Minix 3 packages. I've attempt tens of times and, happily and finally, succeeded to use JWM instead of the default window manager "TWM". Although Chris Double ported "wmii" for Minix 3, I can't really be familiar with the window manager and my VMware too.
The problem of wmii is when I drag or resize a window too many times of screen refreshing are occurred and, therefore, VMWare goes crazy. When I finish the setup and change xinit files, it works really fine, especially on VMware.
JWM provides better way of windows management, especially for resizing and dragging. Moreover, it has windows list at the bottom of the screen which is really sophisticated then TWM or wmii (although it's too basic feature for current Linux world).
The following is the screent shot of using JWM on Minix 3.
JWM on Minix 3
Full Size Image : http://www.taeshinsoft.com/dbkim/images/minix/jwm_on_minix.png
How to configure X11 for running JWM instead of TWM
Go the xinit directory.
# cd /etc/X11/xinit/
# vim xinitrc
At the end of the file, there are a number of lines that executes TWM so the lines have to be changed.
# start some nice programs
# Running JWM Windows Manager
jwm # JWM Windows Manager
# Running TWN Windows Manager
# twm &
# xclock -geometry 50x50-1+1 &
# xterm -geometry 80x50+494+51 &
# xterm -geometry 80x20+494-0 &
# exec xterm -geometry 80x66+0+0 -name login
I uncommented all the twm and rest of four lines of codes (total five lines) and add "jwm" instead.
After that copy the file to the root folder as following.
# cp xinitrc /root/.xinitrc
# cp xinitrc /root/.xsession
This is it! become a root and execute xdm
# xdm
After one minute or two, the xdm shows X11.
There is a strange happening though. When you clicked right button of mouse, it will show a pop-up menu and the menu automatically contains some sort of common application's command links (which never works! it's impossible) such as Firefox and Gaim. I think it's a kind of predefined menu set and I haven't figure out how to fix or remove those things. I may find out after my final exam period. Except this happening, it's so gorgeous. TWM and wmii is too crappy compare t JWM (Sorry Chris).
Last Updated ( Tuesday, 31 October 2006 )
Post a Comment
<< Home