Team LiB
Previous Section Next Section

Hack 34. Give Your Desktop X-Ray Vision

This hack won't let you see through anyone's clothes, but it will make your applications translucent so that anything behind the applications shows through, as if you have X-ray vision. You simply issue a command, and then click a window. Poof!the window suddenly becomes as translucent as you want.

If you want to use this hack you need to have a recent version of the Xorg X Window System, and you need to install xcompmgr, as covered in [Hack #33] . If you can't get xcompmgr to work, you won't be able to get this hack to work, because this hack needs to have xcompmgr running in the background.

Once xcompmgr is working and running in the background, you need the transset program. Once again, this is an experimental program, so you probably won't find it in the regular package repositories for your Linux distribution. You might find that an RPM package for xcompmgr includes transset, or you might have to find a separate transset package. If all else fails, you can always download the program and compile it yourself. Here's how (no password is required, so just press Enter when prompted for a password):

# cvs -d login
CVS password: (press Enter)
# cvs -d co transset
# cd transset
# make
# chmod +x transset
# cp transset /usr/bin

Let's assume you have a window manager or desktop environment running, and you have already launched xcompmgr (see the previous hack for a sample xcompmgr command). Now, all you have to do is issue the transset command, followed by the degree of opacity you want. For example, open an X terminal and type this command:

# transset 0.7
got arg 0.7
d is 0.7

You should see the cursor change to a crosshair (or something like one). Click the window you want to make translucent. It is probably best to click the window's titlebar. Now you should be able to see the wallpaper or even other windows behind the window you just clicked. See Figure 4-4 for an example of xterm with a degree of transparency. In case you're not aware of this fact, the xterm program has no built-in capability to emulate transparency, so you cannot get this affect with an xterm without using transset.

Figure 4-4. An xterm with true transparency

Something such as the following text should also appear in the X terminal where you typed the transset command:

opacity 0xb3333332
Set Property to 0.7

If you want a real thrill (and your window manager has the ability to display the contents of windows while moving, instead of just outlines), move the see-through window around. This is not "fake" translucency, where the window manager has to wait until you have finished repositioning the window for it to redraw the background through the window. It changes in real time, even as you move windows over the wallpaper or other windows.

The transset program is at an even more experimental stage than the xcompmgr program on which it relies. No fancy features are available for making your window manager know which windows should be transparent, and to what degree. If you want transparent windows, you're going to have to go through the process of making them transparent manually every time you start your desktop.

No doubt this will be made user-friendly in the future. In the meantime, it's not all that difficult to streamline the process of making windows transparent. You can add a menu entry or create an icon on the desktop that executes the transset 0.7 command. When you want to make a window transparent, just click the icon (or select the menu entry) and then click the target window.

    Team LiB
    Previous Section Next Section