SaltyCrane Blog — Notes on JavaScript and web development

Install wmii snapshot 20090703 on Ubuntu Jaunty

On Friday I installed the latest snapshot of wmii, the lightweight, tiling, dynamic, scriptable, keyboard navigatable window manager. (See my wmii tag for more posts about wmii.) Wmii orangizes windows into columns. Traditionally there has been three modes for each column: default, stack, and max. "Default" shows all windows in a column. "Stack" shows only one window at a time with the title bars of the other windows showing. "Max" shows only one window without any other titlebars. I usually use two columns each in stack mode. To navigate windows, I use Mod4+j/k to move among windows in a column and Mod4+h/l to move between columns. This has worked well for me, but sometimes I wanted to display two windows in a column while keeping the rest of the windows hidden. Thankfully, the latest snapshot of wmii now includes a new mode which solves my problem. It is a hybrid of the "default" and "stack" modes. It is called "defalut-max" and it allows for multiple stacks of windows per column. There is also a "default+max" mode which is like a hybrid of the old "default" and "max" modes. Additionally these modes now apply to the floating layer as well.

Another really cool thing about the latest wmii snapshot is that it now includes a Python library to interface with the wmii filesystem and a wmiirc written in Python. This should make it a lot easier to script wmii. This is exciting stuff. Thanks to Kris Maglione and the wmii contributors.

Here are my notes for installing wmii snapshot 20090703 on Ubuntu 9.04 Jaunty.

Install prerequisites

  • $ sudo apt-get install build-essential xorg-dev
    $ sudo apt-get install dwm-tools
  • This is so it can find the freetype headers.
    $ sudo ln -s /usr/include/freetype2/freetype /usr/include/freetype

Install wmii

  • Download wmii+ixp-snap20090703.tgz from the wmii homepage and save it to ~/incoming.
  • Unpack
    $ cd ~/incoming
    $ tar -zxvf wmii+ixp-snap20090703.tgz
  • make config
    $ cd ~/incoming/wmii+ixp-snap20090703
    $ make config
    Accept all defaults except set PREFIX=/home/saltycrane/lib/wmii_20090703

  • make & make install
    $ make 
    $ make install
  • Create links in my ~/bin directory:
    $ cd ~/bin
    $ ln -s ~/lib/wmii_20090703/bin/* .

Use the fun Python wmiirc

  • Copy the Python files to ~/.wmii-hg. This includes the pygmi directory, the pyxp directory, and the two wmiirc files.
    $ cp -r ~/incoming/wmii+ixp-snap20090703/alternative_wmiircs/python/* ~/.wmii-hg/
  • Edit ~/.wmii-hg/wmiirc.py as desired.

Run wmii

  • Create ~/.xsession:
    xmodmap ~/.Xmodmap
    gnome-screensaver&
    gnome-power-manager&
    nm-applet --sm-disable&
    urxvt&
    
    until wmii; do
        true
    done
  • Log out of the current window manager and then select X client script as the session and log in.

Install slock screen locker

  • Download from http://tools.suckless.org/slock
  • $ tar zxvf slock-0.9.tar.gz 
    $ cd slock-0.9 
    $ sudo make clean install 
    
  • Running slock: Simply invoke the 'slock' command. To get out of it, enter your password.

Freetype header error

The first time around, I got the following error:

In file included from /usr/include/X11/Xft/Xft.h:39,
                 from ../include/x11.h:9,
                 from cmd/wmii9menu.c:49:
/usr/include/ft2build.h:56:38: error: freetype/config/ftheader.h: No such file or directory
In file included from ../include/x11.h:9,
                 from cmd/wmii9menu.c:49:
/usr/include/X11/Xft/Xft.h:40:10: error: #include expects "FILENAME" or 
In file included from ../include/x11.h:9,
                 from cmd/wmii9menu.c:49:
/usr/include/X11/Xft/Xft.h:60: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘_XftFTlibrary’
/usr/include/X11/Xft/Xft.h:94: error: expected specifier-qualifier-list before ‘FT_UInt’
/usr/include/X11/Xft/Xft.h:101: error: expected specifier-qualifier-list before ‘FT_UInt’
/usr/include/X11/Xft/Xft.h:198: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/X11/Xft/Xft.h:303: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/X11/Xft/Xft.h:362: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘XftLockFace’
/usr/include/X11/Xft/Xft.h:401: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/X11/Xft/Xft.h:407: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
/usr/include/X11/Xft/Xft.h:416: error: expected declaration specifiers or ‘...’ before ‘FT_UInt’
/usr/include/X11/Xft/Xft.h:417: error: expected declaration specifiers or ‘...’ before ‘FT_UInt’
/usr/include/X11/Xft/Xft.h:426: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘XftCharIndex’
/usr/include/X11/Xft/Xft.h:459: error: expected ‘;’, ‘,’ or ‘)’ before ‘*’ token
make[1]: *** [wmii9menu.o] Error 1
make: *** [dall] Error 2

Per this discussion, I solved the problem by creating a symbolic link:

$ sudo ln -s /usr/include/freetype2/freetype /usr/include/freetype

Comments


#1 PPmarcel commented on :

Hello.

I gave up with wmii some month ago for trying other window managers (dwm, awesome). But recently i realized that wmii is now really ahead packages available in many distributions, so i'm back :)

I have installed wmii_20090703 tonight on gentoo and it works like a charm. But how can i use hybrids modes?


#2 Eliot commented on :

PPmarcel,
In "default-max" mode (Mod+d), you can use the box in the top left corner of the window to click and drag a window on top of another window. I'm not sure how (or even if it's possible) to do this with the keyboard. Then you can use Mod+j/k to move up and down between windows as usual or Mod+Ctrl+j/k to move between stacks. I've noticed the windows will move between stacks with certain key navigation patterns. I'm not sure if this is a bug or part of the design.

Also, check out the new modes for floating windows. Mod+m will show only the active floating window while hiding the rest. Mod+j/k will cycle between them. Mod+s is like Mod+m except only the title bars of the inactive windows are shown. And mod+d is the normal behavior found in prior versions of wmii.


#3 Wieland commented on :

Moving windows around in default-max mode is pretty easy. $MODKEY-Shift-$DIRECTION is how you do it (i.e. Mod4-Shift-Left) to send a window to the left. If that's not in the default wmiirc/rc.wmii you can bind your keys to
wmiir xwrite /tag/sel/ctl send sel DIRECTION


#4 Eliot commented on :

Wieland,
Thanks for your comment. I was actually trying to create a new "stack" in the new hybrid default-max mode so that there are two "stacks" each showing one window and only showing the titlebars of the rest of the windows. I know I can do this with the mouse but don't know how to do it with the keyboard.