Simple and Light Simple and Light
Total Page:16
File Type:pdf, Size:1020Kb
LINUXUSER DeskTOPia: JWM JWM Window Manager SIMPLESIMPLE ANDAND LIGHTLIGHT JWM is a window manager for Linux users who demand an efficient GUI and are not afraid to fire up an editor to get it. If this sounds like the kind of tool you are looking for, read on to discover more about JWM. BY HAGEN HÖPFNER f you install a major Linux distribu- the sources is very easy as there are very switch to GUI mode. To make sure that tion, you will probably get the KDE few requirements to fulfill. All you need JWM launches when you do so, add the Ior GNOME desktop. But neither of is the gcc compiler, and the developer following line: the big guns is renowned for a frugal use packages for libxpm and the GUI desk- of CPU and memory resources. If your top. If you have Suse Linux 9.2, you will exec /usr/local/bin/jwm system is short on power, you may be find the X header files in xorg-x11-devel. looking for an alternative. If you have a distribution based on the to the .xinitrc file in your home direc- One of your options is JWM (Joe’s XFree86 package rather than Xorg, you tory. If you use a GUI-based login man- Window Manager) [1] . JWM (Figure 1) will find the developer files in the ager such as KDM or GDM, you can add got its name from its developer, Joe Xfree86-devel package. an entry for JWM to the login manager Wingbermuehle. Joe made sure JWM Unpack the source code from the proj- menu. does not rely on countless libraries, ect homepage and change to the direc- restricting dependencies to the X tory this step creates, jwm-0.21. Then First Steps Window system only. give the commands ./ configure, make, The first time you launch JWM, you and su -c “make install” to build the should at least have your own configura- Installation executable and copy it to /usr/ local/ bin. tion file, which will need to include a JWM does not provide any ready-to-run The easiest way to launch JWM is to menu entry for launching a terminal. binary packages, but building JWM from go to text mode and then type startx to The system global configuration is 80 ISSUE 57 AUGUST 2005 WWW.LINUX - MAGAZINE.COM DeskTOPia: JWM LINUXUSER Listing 1: JWM Sample Menu 01 <RootMenu label="Start" icon="start.xpm"> 02 <Program icon="konsole.xpm" label="xterm">xterm</Program> 03 <Menu icon="folder.xpm" label="Internet"> 04 <Program icon="mozilla.xpm" label="Firefox">firefox</ Program> 05 <Program icon="mozilla-mail.xpm" label="Thunderbird">thunder bird</Program> 06 <Program icon="licq.xpm" label="Licq">licq</Program> 07 </Menu> 08 <Separator/> 09 <Restart icon="reload.xpm"/> 10 <Exit icon="exit.xpm"/> 11 </RootMenu> 12 <Icons> 13 <IconPath>$HOME/.jwm_pics</IconPath> 14 </Icons> Listing 2: Tray configuration 01 <Tray autohide="false"> 02 <Font antialias="true">-adobe-helvetica-*-r-*-*-12-*-*-*-*-*-*-*</Font> 03 <Width>500</Width> <!-- Tray width (Default 1024) --> 04 <Height>20</Height> <!-- Tray height (Default 28) --> 05 <Alignment>center</Alignment> 06 <Foreground>black</Foreground> original photo: www.sxc.hu photo: original 07 <Background>#DCDAD5</Background> 08 <ActiveForeground>black</ActiveForeground> 09 <ActiveBackground>#8899AA</ActiveBackground> 10 </Tray> The window decorations are reminiscent modify JWM to suit your own prefer- of FVWM [2]. The window title bar ences, as the standard configuration placed in the /usr/ local/ etc folder when includes buttons for iconizing, maximiz- would probably only make JWM’s devel- you install JWM. Copy the system.jwmrc ing, and closing the window. Also oper happy. The first thing to do is to set file to your home directory as .jwmrc. included is an icon on the left, which up the menu to support the applications Then open the file in an editor and opens the window menu on right click- you have installed on your system. change the program name xwsh in line 7 ing. The menu can contain submenus, to the name of your favorite terminal, program launchers, separating lines, and that is xterm or konsole for example. Configuring the Menu internal JWM calls. The internal JWM After completing these preparatory You can use the menu to move the win- calls help you terminate JWM, for exam- steps, you can launch a basic JWM con- dow to another virtual desktop or send it ple. The current version does not sup- figuration for the first time. At the bot- to the background in the current win- port re-launching the window manager tom edge of the screen you will see a dow. If you prefer to do without a via the menu. When we selected an tray that includes a menu, a pager, a mouse, JWM supports keyboard short- entry to try this, JWM crashed. Listing 1 CPU load indicator, and a clock. Later cuts that are very reminiscent of the is a simple example that results in the on, JWM will display a list of active KDE shortcuts. For example, [Alt]+ menu shown in Figure 2. programs in the middle. [Tab] toggles between the windows on The first line tells JWM that the menu You might like to select the Terminal the current desktop, and pressing definition follows. The next line has an menu entry to launch the application [Alt]+[F4] closes an application. entry for launching an xterm. Besides you configured in your configuration file. You can edit the configuration file to the label displayed for the menu entry WWW.LINUX - MAGAZINE.COM ISSUE 57 AUGUST 2005 81 LINUXUSER DeskTOPia: JWM If four virtual desktops are not enough for you, you can increase the number in the <DesktopCount>4</ Desktop- Count> line. Make sure you use a value between 1 and 8. JWM defines a few keyboard shortcuts by default, however, you can add to the list by defining your own shortcuts. Place your keyboard shortcuts at the end of the .jwmrc file. To define a keyboard shortcut, you need an entry with the fol- lowing syntax: <Key mask=“Modifier” key=“Taste”>Aktion</ Key>. The Modifiers include A for [Alt], C for [Ctrl] and S for [Shift]. A line with <Key mask=“A” key=“F4”>close</ Key> in .jwmrc will close a window when you press [Alt]+[F4]. To launch an application when you enter a keyboard shortcut, specify exec: as the action, followed by the program name. For example, the following line <Key mask=“C” key=“T”>exec: Figure 1: JWM is a versatile desktop that is easy on resources. xterm</ Key> launches an xterm when you press [Ctrl]+[T]. (label=“xterm”), the line also specifies pointer happens to be at the bottom an icon – icon=“konsole.xpm”. To allow edge of the screen. Font sets the font Conclusions JWM to find the icon, the image file for type. JWM is a small footprint window man- the icon needs to be stored below the You can use the xfontsel tool to ager with surprisingly convenient icon path, which is $HOME/ .jwm_pics in discover the fairly cryptic font names. features. If you are not afraid of text- this case. The window manager can only Width defines the width (minimum based configuration, you can easily set handle xpm-formatted graphics. 320), Height defines the height (mini- up JWM to reflect your preferences. As To use the icons you already have mum 8 point, maximum 128 point), and JWM is under active development, installed, you can call convert to convert Alignment the vertical alignment of the someone may already be working on the PNG icons below /usr/ share/ icons to tray, which can be left, center, or right. the problem that occurred when we the required format and store them If you set the width to 0, the tray will attempted to re-launch the manager below /home/ username/ take up the whole width via the menu entry. Watch for a new .jwm_pics. The line with the of the screen. The color version with a solution to this problem <Separator/ > string adds a values for the Foreground at the JWM project website. ■ separating line to the menu. and Background colors The sample listing also can be input as hex val- INFO changes the label of the Figure 2: The start menu ues, as in HTML files, or [1] JWM Homepage : http:// joewing. net/ defined in Listing 1. menu button, which started by specifying the color programs/ jwm/ index. shtml off as JWM. The label= names. The showrgb | [2] FVWM homepage: “Start” entry in the menu definition less command tells you the names recog- http:// www. fvwm. org/ changes the label to Start (Figure 3). nized by your system. The easiest way to [3] JWM configuration: http:// joewing. find out the hex color values is to use a net/ programs/ jwm/ config. shtml Tray Dressing program such as kcolorchooser. You can use the entries between <Tray> and </ Tray> in the .jwmrc file Desktop Convenience Dr. Hagen Höpfner to modify the appearance, size, and By default, JWM allows the focus to fol- is an author and computer scientist color of the panel, as shown in Listing 2. low the mouse cursor. If you prefer to who is a regular The autohide=“false” definition in click to shift the focus, replace sloppy contributor to Linux line 1 prevents the tray from disappear- with click in the following line Magazine. He cur- ing into the background. You can change rently serves as a this behavior by specifying autohide= <FocusModel>sloppy</FocusModel> lecturer in Com- puter science at the International “true” to automati- THEAUTHOR cally hide the tray, University of Germany in Bruchsal, unless the mouse Figure 3: JWM with a modified start button in the tray.