<<
Home , Twm

LINUXUSER Brightside and Devil’s Pie

Metacity add-ons Brightside and Devil’s Pie CITY LIGHTS Philip Date - FOTOLIA

If the no-frills doesn’t give you the functio- nality you need, try the Metacity add-ons Brightside and Devil’s Pie.

BY OLIVER FROMMEL

oftware is no exception to the specify various actions for the desktop to You will find Brightside in the Gnome rule that there’s no accounting perform when launching programs. Both menu below System | Preferences | More Sfor taste. Some users enjoy a full- programs use Extended Window Man- Preferences. Brightside is configured featured, almost baroque approach, ager Hints [2] to communicate with the using the brightside-properties tool (Fig- while others prefer to keep things more window manager. ure 1). To enable the actions you config- business-like. Window managers take ure with Brightside, you either need to this choice to extremes, from the mini- Active Corners launch Brightside manually, or add it malist TWM to the highly complex En- Some distributions, such as Ubuntu Dap- to the list of programs to launch when lightenment, a window manager that per Drake and Fedora Core 5, include starting a Gnome session in -ses- decorates its windows with bells, whis- Brightside in their repositories. As an al- sion-properties. tles, and even animations [1]. ternative, you can always build Metacity, the window manager for the the program yourself using the Gnome desktop, is designed for simplic- packages from [3]. Brightside ity and does not confuse users with an is fairly frugal with respect to overabundance of options. To achieve dependencies; in fact, you this aim, Metacity concentrates on the mainly just need the typical window manager’s core business: draw- Gnome libraries. ing window decorations, organizing win- Libwnck is the slightly un- dows, and moving windows. Gnome ap- usual exception to this rule. plets step in to handle additional func- Libwnck serves up information tions such as virtual desktops. on the active desktop pro- This article describes a pair of pro- grams and facilitates program- grams called Brightside and Devil’s Pie ming of tools such as task that add useful features to Metacity. switchers. Brightside provides mouse support to After giving the make install the corners and edges of the Gnome command to install the pro- desktop, allowing users to toggle be- gram, you should have the tween virtual desktops, for example. brightside and brightside-prop- Figure 1: Brightside lets users assign an action to each Devil’s Pie gives users the ability to erties binaries on your disk. corner of the desktop.

80 ISSUE 70 SEPTEMBER 2006 WWW. - MAGAZINE.COM Brightside and Devil’s Pie LINUXUSER

A default action is configured for each desktop, or whether to use of the four corners of the screen; you can window decorations. It is defi- modify the action in the drop down from nitely worthwhile adding Dev- disabling and enabling sound output, il’s Pie as a permanent feature enabling the screensaver, or even hiber- for any Gnome session. nating a machine. Unfortunately, all of these actions are Lisp Syntax hard-coded instead of being defined Preferred over XML through a configuration file. In our lab, Up until version 0.12, Devil’s the start screensaver function did not Pie used XML-formatted con- work because it uses commands for the figuration files, but 0.13 intro- Xscreensaver tool, which Fedora Core 5 duced a syntax based on S ex- does not have. pressions, which are mainly seen in the context of the Lisp Defining Actions programming language. The Metacity supports custom actions that files reside in the $HOME/.dev- let you assign actions other than the de- ilspie directory and are recog- Figure 2: The Custom action setting gives users the faults to reactive corners. When you se- nizable by their .ds extension. ability to specify a program for Brightside to run. lect a custom action, Brightside pops up Each file can only contain a a small dialog where you can enter the single rule that governs a single applica- (if program to run (Figure 2). To start the tion. For example, the following expres- (matches (application_name) U Fedora Core 5 screensaver via a reactive sion sends the application window to the "Firefox") corner, just enter gnome-screen- second when the Amule (begin saver-command -activate for On entering P2P client is launched: (geometry "600x800") region. You do not have to configure the (center) options Brightside gives you for leaving (if ) the reactive corner: the screensaver is (is (application_name) U ) automatically disabled when you drag "amule") the mouse. (set_workspace 2) The Devil’s Pie Wiki [6] and the tutorial ) at [7] provide more details on using and Smooth Switching configuring Devil's Pie. The edge flipping feature, which lets you The following configuration file maxi- switch between virtual desktops when mizes the Kaffeine media player at Almost Perfect you drag the mouse over the left or right launch: Devil’s Pie uses simple text files to con- edge of the screen, is also an interesting trol how the desktop handles applica- Brightside option. A configurable delay (if tions you launch. Brightside adds reac- prevents inadvertent switching (see Fig- (matches U tive corners and edge flipping. ure 1). Incidentally, Brightside not only (application_name) U Unfortunately, Brightside is not as works with Metacity. In our lab, we dis- "Kaffeine Player") flexible as it could be, as it only supports covered that it would support (maximize) simple user-configurable actions. A con- and WMX, two alternatives to Metacity ) figuration file that specifies basic actions on Fedora. might be a better approach. ■ Using the fullscreen keyword instead of Devil’s Pie maximize would launch Kaffeine in full- INFO The Metacity developers have deliber- screen mode. If you change a configura- [1] Overview of X window managers: ately avoided adding a feature that orga- tion file, don’t forget to relaunch devils– http:// xwinman. org nizes windows in an intelligent way. In pie to apply the changes. If the changes [2] Extended Window Manager Hints: the developers’ opinion, this is not part do not have the desired effect, set the -d http:// standards. freedesktop. org/ of the window manager’s job descrip- flag when launching the program for wm-spec/ wm-spec-1. 3. html tion. Instead, Gnome developer Ross troubleshooting. As an alternative, you [3] Brightside: http:// home. jesus. ox. ac. uk/ Burtonini fired up his editor and com- can add a (debug) directive at the end of ~ecatmur/ brightside piler, and wrote a tool that fills the gap. the configuration file. [4] Devil’s Pie: http:// www. burtonini. com/ Devil’s Pie [4] gives users the ability to Devil’s Pie can handle regular expres- blog/ computers/ devilspie specify what happens to an application sions, just like any decent Unix tool, [5] S Expressions: http:// theory. lcs. mit. at launch time based on configuration using the matches keyword. If you want edu/ ~rivest/ sexp. html files. The configurable behavior includes the program to execute a group of in- [6] Devil’s Pie Wiki: how to organize the application window structions for a single application, the http:// live. gnome. org/ DevilsPie on screen, whether to add an entry to begin keyword indicates the start of the [7] Devil’s Pie Tutorial: http:// wiki. foosel. net/ linux/ devilspie the task list, the position on the virtual group:

WWW.LINUX - MAGAZINE.COM ISSUE 70 SEPTEMBER 2006 81