A Look at the Wmii Window Manager
Total Page:16
File Type:pdf, Size:1020Kb
LINUXUSER Desktopia: Wmii A look at the Wmii Window 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 Debian, Gen- Wmii window manager. BY NICO GOLDE too, or Arch Linux. 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 Ratpoison your environment. Wmii deliberately Wcommon method of interact- [1], Ion [2], and Larswm [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 virtual desktop. 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]+[Tab] 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 shell 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.