LINUX USER SchlagwortDeskTOPia: sollte WMI hier stehen

WMI and the reincarnation of the keyboard LIGHTLIGHT ANDAND SPEEDYSPEEDY www.photocase.de WMI is a lean and fast manager with good support for keyboard control. BY PHILIPP KLEIN

eyboard fans who prefer a lean not new, Other projects such as Listing 1 will have no effect on the environment have a difficult [2], [3], evilwm [4] and GUI-based login via GDM or KDM. Ktime. Most window managers [5] have a similar philosophy. All of have menus, panels, or even icons, but these tools give users two different Off We Go! launching individual programs is modes. The lower part of the screen has The first time you launch WMI, you will restricted to point & click. Large-scale a line for command input, which is see no menus or any other means of projects such as KDE and Gnome enabled by pressing [ALT + e]. In com- launching your normal applications by include sophisticated animations and mand mode, users can launch programs pointing and clicking. Instead, you are other functions that many users do not installed on the system; in other words, shown a window with the WMI man- need, and these functions have the effect the fulfills the role of a page, which describes the first steps and of slowing down the window manager. simple terminal. The second mode in explains the way the two modes work. Window Manager Improved (WMI) is WMI is for shortcuts [ALT + i]. So let’s start there. The first thing we a fast and lean window manager with a want to do is tidy up the desktop. I will special emphasis on the keyboard [1]. Installation divide the desktop into a number of WMI offers extra speed that improves The WMI project homepage at [1] has areas or workspaces. Readers may be the user experience on older hardware. downloads in various formats. Besides familiar with this approach, as most the source code archives, these down- window managers have workspaces or Approaches and Ideas loads include binary packages for virtual desktops. It makes sense to set up The idea of a minimal window manager Debian, Slackware, and RPM. You can a number of workspaces to help you with mainly keyboard-based controls is use the normal steps to install a package, and building the source code also fol- Common Shortcuts in WMI Listing 1: ~/.xinitrc lows the standard sequence:"./configure; [Alt + I] Enable input mode make; sudo make install. After installing 01 #!/bin/sh [Alt + E] Enable exec mode WMI, you need to set WMI as your 02 exec /usr/local/bin/wmi [Esc] Quit input / exec mode default window manager. If you log on 03 [Alt + M] Maximize a window in text mode, the ~/.xinitrc entry shown 04 if test -x $HOME/.wmi/sti.pl ; [Alt + D] Detach (hide) a window in Listing 1 will do the trick. (The last then [Alt+ A] Attach (restore) a window three lines in the file are not relevant for 05 $HOME/.wmi/sti.pl & [Alt + Tab] Toggle between windows the time being, but we will look at them 06 fi [Ctrl + Alt + Q] Log out later.)

78 ISSUE 54 MAY 2005 WWW.- MAGAZINE.COM DeskTOPia: WMI LINUX USER

corner of the pro- mapping shortcuts. The examples shown gram window, or in Listing 2 are from my own collection. you might find it Many of the commands are self- quicker to press explanatory, but let’s have a closer look. [ALT + M]. Line 1 maps CTRL + s to the command Follow the same for toggling between workspaces. If you steps to create are in Workspace 3, pressing CTRL + s more workspaces. will take you to workspace 2. Lines three Typing: through eight contain shortcuts for explicitly switching between work- save-settings spaces. ALT + 1 takes you to Workspace 1 (which is “IRC” in this case). In the Figure 1: WMI provides a simple and convenient interface. will allow the same vein, ALT + 2 takes you to Work- workspace set- space 2 and ALT + 3 to Workspace 3. keep track; you could organize your tings survive the next boot. Of course, you can use shortcuts to environment by application type, for If you want to launch an application run external commands. For example, example. One workspace could be for automatically after logging in, you must Lines 10 and 11 tell WMI to launch Fire- communication (email, IRC, Jabber, …), specify an entry in the ~/.xinitrc file. To fox when I press SHIFT+F9. More a second for surfing the Internet, and a launch an called in the top “advanced” shortcuts are also possible, third for working with OpenOffice. To right-hand corner of the workspace: for example, the shortcuts in lines 13-25 create these workspaces, we first need to that control the xmms audio player. enable input mode by pressing [ALT + exec wmiremote -a U i], which gives us access to WMI-specific select-workspace+web Extending WMI commands. Now type exec firefox & WMI is easily extensible and config- urable using themes and scripts. You’ll create-workspace Finally, log out by pressing [ALT + q] find a collection of themes at [6] that and log back on again to make sure that you can adapt to suit your own favorite and you are prompted to enter a name the configuration is working correctly. colors. It is quite easy to install a theme: for the new workspace. Typing Browser Note: You can display a list of the cur- simply copy the theme.conf file for the creates a workspace with this name. The rently defined shortcuts by typing new theme to ~/.wmi. workspace appears at the bottom of the The Perl script wmi.pl [7] shows just desktop. To launch a browser, you first wmiremote -p | less how easy it is to script WMI extensions. need to enable command mode by press- For example, the script adds a status bar, ing [ALT + e]. You can then enter Individual Configuration which gives you details on the system Admittedly, our current set of WMI con- load, the number of read and unread firefox trols is a bit unintuitive. So let’s add a messages, and the time of day. To install few shortcuts of our own to WMI. the script, you need to run it before you to launch the Firefox browser. If you Change to the WMI configuration launch WMI (e.g., via ~/.xinitrc). The want to restore the window to full size, directory below ~/.wmi. The top ~/.xinitrc box explains how to click on the button in the top right-hand actions.conf file in this folder is used for install the wmi.pl script. Of course, the Perl script has to reside in ~/.wmi, and Listing 2: Die ~/.wmi/actions.conf it needs appropriate privileges to run ■ 01 intern.cycle-workspace-prev. 12 correctly. keys=ctrl+s 13 # Rewind in XMMS INFO 02 14 extern.xmmsr.cmd="xmms -r" 03 chain.wsia.seq="select- 15 extern.xmmsr.keys=shift+F5 [1] Official project homepage: workspace+irc" http://wmi.modprobe.de 16 # Play or continue current 04 chain.wsia.keys=alt+1 [2] larswm: http://home.earthlink.net/ track 05 chain.wsis.seq="select- ~lab1701/larswm/ 18 extern.xmmst.cmd="xmms -t" workspace+web" [3] ION: 19 extern.xmmst.keys=shift+F6 06 chain.wsis.keys=alt+2 http://modeemi.cs.tut.fi/~tuomov/ion/ 07 chain.wsio.seq="select- 20 # Stop current track [4] evilwm: http://evilwm.sourceforge.net/ workspace+shell" 21 extern.xmmss.cmd="xmms -s" [5] ratpoison: 08 chain.wsio.keys=alt+3 22 extern.xmmss.keys=shift+F7 http://www.nongnu.org/ratpoison/ 09 23 # Skip one song in the [6] WMI Themes: http://wmi.modprobe. playlist 10 extern.firefox.cmd=/usr/bin/ de/index.php/WMI/Themes firefox 24 extern.xmms.cmd="xmms -f" [7] sti.pl: 11 extern.firefox.keys=shift+F9 25 extern.xmms.keys=shift+F8 http://www.dcs.gla.ac.uk/~lativyn/sti/

WWW.LINUX- MAGAZINE.COM ISSUE 54 MAY 2005 79