<<

LINUXUSER Desktopia: Wmii

A look at the Wmii Manager NO WIMPS Wiki-based site, which also offers an as- If you’d rather rule the desktop from your keyboard, try the powerful sortment of packages for , Gen- Wmii . BY NICO GOLDE too, or Arch . Give the tar xvzf wmii-2.tar.gz command to unpack the package. This step creates a wmii-2 sub- directory with the config.mk configura- IMP (“Windows, Icons, combines the attributes of venerable and tion file, which you can modify to reflect Menus, Pointing device”) is a popular developments such as your environment. Wmii deliberately Wcommon method of interact- [1], [2], and [3]. For exam- does without a configure script, but the ing with GUIs. It involves controlling ple, it uses multiple layouts and tabbing. defaults are fine in most cases. menus, windows, and colorful buttons But one thing is new: Wmii can be con- Type make, and then make install to by pointing and clicking. According to trolled via a Socket-based, virtual file build and install the program. The only Anselm Garbe, the author of Wmii (Win- system. The file manager also has a requirements are the GCC C compiler dow Manager Improved 2), this method modular structure. Wmibar provides the and the X header files. (Debian users is inefficient and obsolete. status bar, and Wmimenu the menu. need the libx11-dev package, which Suse Wmii (Figure 1) is a complete rework Wmikeys handles keyboard shortcuts, 9.3 calls xorg-x11-devel.) To launch the of the Wmi window manager. Wmii sup- Wmifs is responsible for the the file sys- window manager, Debian users can cre- ports keyboard controls throughout, just tem, and Wmir manages file system ma- ate a .xsession file in their home directo- like its predecessor Wmi. This extensive nipulation. ries and enter the following lines: system of keyboard controls means that there is no need for a mouse, although Installation and #!/bin/sh you can still use one if you like. Configuration exec /usr/local/bin/wmii You need the wmii-2.tar.bz2 package for Design the install; the package is available from To add Wmii to the list in your standard Keyboard-based window managers have the download area of the Wmii project login manager on Suse 9.3, create a been around for many years, but Wmii homepage [4]. Users can add to the wmii.desktop file in /usr/share/xses-

82 ISSUE 64 MARCH 2006 WWW.LINUX - MAGAZINE.COM Desktopia: Wmii LINUXUSER

Figure 2: Wmii is pre-configured when first launched. A tutorial helps Figure 1: Wmii with system statistics and a bleak forest. you get started with the keyboard-controlled Wmii window manager. sions, and add the following lines to current desktop, followed by a letter as button, Wmii interprets the selected text that file: an abbreviation of the layout, and an- as a URL. The date and system load are other letter for the current shortcut displayed on the right of the status bar. [Desktop Entry] mode (n for “normal,” r for “resize,” m This is also where program output is dis- Encoding=UTF-8 for “move,” and b for “bare.”) Adjacent played, and this allows you to view the Type=XSession to this is a www button that launches a results of any scripts you happen to Exec=wmii browser when clicked. The button is write. TryExec=wmiiwm freely configurable and also has a neat Pressing [Ctrl]+[Alt]+[P] displays a Name=wmii trick: right clicking www opens a Google command line in the status bar, letting Comment=U search based on a selection in any pro- you call external programs, and provid- window manager improved 2 gram. If you click with the middle mouse ing command completion. Pressing [Ctrl]+[Alt]+[A] gives you a similar Getting Started Layouts function for internal window manager When you launch Wmii for the first control commands. Directional com- Wmii offers a variety of screen layouts, time, a window with a tutorial appears, which apply to just one . mands in Wmii use the [H],[J],[K] and and it makes sense to read the tutorial [L] keys (just like in Vi), where [H] Tiled Layout carefully before you start pressing keys stands for right, [J] for down, [K] for up, (Figure 2). [Alt]+[T] pops up a terminal The “tiled” layout was originally imple- and [L] for left. window, and [Ctrl]+[Alt]+[Y] creates mented in Larswm. It gives one window You can use the keyboard to expand a large proportion of the space on the new desktops (“pages”); you can toggle windows. To do so, press [Ctrl]+[Alt] desktop, and the other windows share between desktops by pressing +[R] and press one of the directional the remaining space (Figure 3). You can [Alt]+[H]. [Alt]+[Shift]+[P] takes you enable this layout by pressing keys. To quit expand mode, press [Esc] to pager mode, which gives you an over- [Alt]+[Shift]+[T]. in good old Vi style. As you will have view of the active desktops and lets you gathered by now, Wmii has a number of Grid Layout directly change to a desktop. To close a modes that resemble the Vi Editor. There window, just press [Ctrl]+[Alt]+[C]. Pressing [Alt]+[Shift]+[G] gives you the is also a mode for moving windows, “grid” layout. It assigns equal amounts The default layout is called “tiled” (see which is entered by pressing of space to each window, and arranges the “Layouts” box), and as you would [Ctrl]+[Alt]+[M]. Again, use the direc- the windows in a grid (Figure 4). expect, the windows automatically share tional keys to say which direction to Maximized Layout the space available on the desktop. move the window. Pressing [Alt]+[Enter] moves the se- Press [Alt]+[Shift]+[M] to maximize all lected window from a small frame to a the windows on the desktop; you can The Virtual File System large frame – this is what Wmii refers to then press [Alt]+[] to navigate be- Wmii has a virtual filesystem (VFS), tween windows. as “zooming.” If you need a temporary which allows you to control the window full screen view of a window, you can Floating Layout manager via commands and scripts, just press [Alt]+[M] to maximize the page. The floating layout is the one favored by like Procfs in Linux. In fact, the key- Iconizing works the same way. most window managers and desktop board shortcuts just implement com- [Alt]+[Tab] shifts the current focus to environments. It allows applications to mands that use VFS under the hood. the next window. choose their own window size. This is To read from, and write to, the VFS, the layout you need for image manipu- The status bar populates the bottom of you need wmir, which is part of the dis- lation programs such as Gimp. the screen. It displays the number of the tribution. The read and write command

WWW.LINUX - MAGAZINE.COM ISSUE 64 MARCH 2006 83 LINUXUSER Desktopia: Wmii

navigate between files are normal scripts. The bar tabs. To use tab- script takes care of the status bar; keys bing, you first handles keyboard shortcuts. The menu need to unlock the script controls the internal and external current frame to command menu, and wm the window allow it to hold manager itself. The status.sh script cre- multiple windows. ates the status bar output. The most im- You can press portant file for us right now is rc.conf [Alt]+[U] to do (Listing 1): you can use this file to mod- this. ify settings such as the wallpaper and If you then window colors. launch a terminal, Lines 01 through 18 in Listing 1 mod- by pressing ify the appearance of the window man- [Alt]+[T], the ter- ager by setting shell variables, which are minal window referenced by the shell scripts referred to will appear in the earlier. For example, to set the wallpaper, Figure 3: Wmii’s tiled layout, which is enabled by pressing same frame – the just change the value of the WALLPAPER [Alt]+[Shift]+[T]. Wmii’s internal menu is shown lower down. title bar of the variable in line 16: frame is divided to line parameters read and write, and cre- reflect this. To navigate between the two WALLPAPER=U ate allows you to define new entries, windows, press [Alt]+[Shift]+[Tab] in- "Esetroot -scale -center U such as files and directories. Thus, wmir stead of the normal keyboard shortcut. /home/test/.wmii/wallpaper.png" read / will show you the root directory of As tabbing is a mode like any other, this the file system. VFS takes some adjust- function will work in combination with You can also use these files to modify ment but is a pleasure to use after you any layout. Lock the frame again by the keyboard shortcuts for the direc- learn it. To apply a different color to a pressing [Alt]+[Shift]+[U] to avoid tional keys. MODKEY (Line 19) defines window frame, type the following: more new windows opening within the the modifier key that initiates a com- frame. mand. The configuration in Listing 1 wmir write /wm/page/sel/mode/U uses mod1, which maps to the [Alt] key. sel/sel-style/bg-color '#FF00FF' User-specific Configuration If you prefer to use a different keyboard The default installation puts the configu- combination, you will need to modify The following command maximizes the ration files in /usr/local/etc/wmii. You the keys file. current window: can start by copying the whole directory To make temporary changes, just run to ~/.wmii. This gives you the files bar, the wmir command; to make your wmir write /wm/page/sel/ctl U keys, menu, rc, rc.conf, status.sh and changes permanent, add the changes to 'select zoomed' wm, and a directory titled action. The your configuration files. To apply Tabbing Modes Tabbing displays multiple (application) windows in a single frame and lets you

Table 1: Important Wmii Shortcuts Shortcut Meaning [Alt]+[Y] Open a new desktop [Alt]+[H],[L] Toggle between desktops [Alt]+[T] Launch a terminal [Strg]+[Alt]+[C] Close a window [Strg]+[Alt]+[A] Internal command mode [Strg]+[Alt]+[P] External command mode [Strg]+[Alt]+[R] Resize a window [Strg]+[Alt]+[M] Move a window [Alt]+[D] Detach a window [Alt]+[A] Attach a window [Alt]+[Tab] Navigate between windows [Strg]+[Alt]+[Q] Log off Figure 4: Grid view assigns equal space to each window and arranges the windows in a grid.

84 ISSUE 64 MARCH 2006 WWW.LINUX - MAGAZINE.COM Desktopia: Wmii LINUXUSER

changes on the fly, you can simply re- almost any command line program in 2002. It treats all resources (such as load the individual components rather the status bar. computers, users, devices etc.) as files, than relaunching the window manager. and uses a standard protocol, 9P, to ad- The rc (“run command”) file, a simple More Information dress them. The proc file system in init script that calls the typical command In addition to the normal documenta- Linux was inspired by this approach and line parameters start, stop, and restart, tion, wmirefcard opens a PDF document uses something similar. helps you relaunch Wmii. Thus, typing with the most important keyboard short- 9P2000 is a revised and vastly im- the command ./rc restart will reinitialize cuts. The Wmii project homepage [4] proved version of the Plan 9 protocol, Wmii on the fly. has a whole bunch of useful informa- 9P, which was released in 2002 with The action directory has a shell script tion, including a Wmii intro for begin- Plan 9 Fourth Edition. 9P2000 compati- for each option. Whenever you press ners [5] by Steffen Liebergeld. (The intro bility supports mounting the Wmii file [Ctrl]+[Alt]+[A] to run a command is now available in English, German, and system on the existing file system as of from the action menu, or press a key- Spanish.) As the site is Wiki-based, new kernel 2.6.14, and allows users to config- board combination, what you are actu- items are added daily, and you will prob- ure standard programs such as cp, mv, ally doing is launching a script from the ably discover various Wmii themes and echo, or vi via Wmii. This, in turn, re- action directory. additional programs written by Wmii moves the need for the wmir tool in The keys file, for example, tells you users. There is also an active #wmii Linux (although wmir will be retained to which script you are actually launching: channel on the irc.oftc.net IRC server. avoid breaking downward compatibility pressing [Alt]+[T] runs the term script. to BSD systems and other flavors of If you prefer to use aterm rather than Future ). Kernel 2.6.14 is the first to sup- , you can simply modify the term Wmii-3 is due for release in November port the 9P protocol. script to reflect your choice. To modify 2005 and looks likely to introduce a few The dramatic configuration simplifica- the keyboard shortcut, simply modify interesting changes. Until the new re- tion draws on a Unix port of the power- the keys file. The content is fairly self-ex- lease is forthcoming, the project will be ful Plan 9 tools, the Rc shell [8] in partic- planatory, although the changes do re- releasing snapshots of the software at ular, and additional tools for shell quire some patience. The scripts mainly regular intervals. The most important scripts, which the Wmi project bundles use the wmir program, which lets you new features are 9P2000 compatibility to provide 9rc. The advantage of the new modify the window manager to suit your [6] for the virtual file system and a dra- Plan 9 Rc shell is that it is statically needs. For example, the following com- matically simplified configuration thanks linked, and it runs shell scripts far faster mand: to a new shell (9rc). than Bash. ■ Wmii-3 also comes with a new “col- wmir write U umn” layout, based on Rob Pikes INFO U /bar/default/70_status/ programming environment [8] for Plan [1] Ratpoison: label/text 'WMII rocks!' 9, which replaces and integrates previ- http:// www. nongnu. org/ ratpoison ous layouts, such as “tiled,” “grid,” and [2] Ion: will output the string WMII rocks! in “maximized.” http:// modeemi. cs. tut. fi/ ~tuomov/ ion the status bar until you update the Plan 9 is a Unix-style [3] Larswm: http:// home. earthlink. net/ status.sh script. This useful feature gives developed by Bell Labs. The Plan 9 OS ~lab1701/ larswm users the ability to display the output of was released under a free license in [4] Official Wmii homepage: http:// wmii. de Listing 1: rc.conf [5] Introduction to Wmii: http:// wmii. de/ 01 TAB_HEIGHT=16 14 NORMAL_FG_COLOR="#FFFFFF" index. php/ WMII/ BeginnersGuide 02 BAR_HEIGHT=16 15 NORMAL_BORDER_COLOR="#BBBBBB" [6] Introduction to 9P: http:// www. cs. 03 BORDER_WIDTH=3 16 WALLPAPER="xsetroot -mod 2 2 bell-labs. com/ sys/ man/ 5/ INDEX. html 04 SELECTED_BG_COLOR="#666699" -bg #666699 -fg #888888" [7] Rc shell: http:// www. star. le. ac. uk/ ~tjg/ rc/ misc/ td 05 SELECTED_TEXT_SIZE=10 17 DEFAULT_LAYOUT=tiled # tiled, [8] Acme programming environment: max, grid or vsplit 06 SELECTED_TEXT_ALIGN=center http:// www. cs. bell-labs. com/ sys/ doc/ 18 TILE_WIDTH=60 07 SELECTED_TEXT_FONT="fixed" acme/ acme. ps 19 MODKEY=mod1 # modifier key 08 SELECTED_FG_COLOR="#FFFFFF" used by the default key 09 SELECTED_BORDER_ Nico Golde is 19 years old and a stu- bindings COLOR="#9999CC" dent of Computer Science at the 20 NORTHKEY=k Technical University in Berlin. He is 10 NORMAL_BG_COLOR="#888888" 21 SOUTHKEY=j a member of various 11 NORMAL_TEXT_ALIGN=center 22 WESTKEY=h projects, including the Debian proj- 12 NORMAL_TEXT_FONT="fixed" ect – and mainly interested in pro- 23 EASTKEY=l 13 NORMAL_TEXT_SIZE=10 THEAUTHOR gramming and security.

WWW.LINUX - MAGAZINE.COM ISSUE 64 MARCH 2006 85