X.Org/Transparency

From Gentoo Linux Wiki

Jump to: navigation, search

X.Org TOC

This guide is meant to explain how to enable transparency effects in various Window Managers and how to use other X tools for greater control.

Contents

[edit] X Composite Extension

It's essential that you first configure the X server to enable its Xcomposite extension. Add the following to /etc/X11/xorg.conf,

File: /etc/X11/xorg.conf
Section "Extensions"
    Option "Composite" "Enable"
EndSection

Restart the X server for these settings to take effect.

Note: You can verify that the Xcomposite extension is enabled with,
xdpyinfo | grep Composite
Emerge x11-apps/xdpyinfo for the xdpyinfo application.

[edit] Enabling Shadows and Real Transparency

[edit] KDE4

KDE4's KWin4 Window Manger has built-in 3D-plugins, much like Compiz. Emerge KDE's packages with the xcomposite, where applicable, enabled. See System Settings -> Desktop to enable and configure KDE's Desktop Effects.

[edit] KDE 3.x

KDE 3.x's KWin Window Manager has support for composite features provided you set the xcomposite USE-flag when emerging kde-base/kwin and kde-base/kicker for the split ebuilds or kde-base/kdebase using the monolithic ebuilds. Open up KDE Control Center from the KMenu. On the tree on the left, click Desktop->Window Behavior. Click on the Translucency tab and check the Use translucency/shadows option. The various settings are then available for tweaking in the configuration frame. Restarting KDE may be required to enable your new settings.

Note: Make sure you turn off the standard KDE GUI effects (Control Center->Appearance & Themes->Style->Effects->Enable GUI Effects), otherwise the effects will double up and cause strange things to happen.

[edit] Enlightenment 0.16

Enlightenment 0.16 supports the composite extension natively, including transparency and shadows and it requires no special USE-flag. In the default configuration it is not enabled, you have to right-click on the desktop and select Composite Settings. Now you are able to control the features for the different windows by right-clicking on the titlebar (the menu where you can set all differnt kinds of window properties. No restart is required.

[edit] Enlightenment DR17

Enlightenment DR17 cvs does have a module called Bling for controlling drop shadows and window fades. Just unmask and emerge e_modules after emerging e. The module can be activated from Configuration->Modules->Bling.

It is crucial that you issue

enlightenment_remote -use-composite-set 1

as the user who is running e17.

You will also have to deactivate the Dropshadow module in order to get nice shadows which do not interfere with the Bling shadows.

[edit] Xfce

Settings -> Window Manager Tweaks -> Compositor

[edit] Tools

Fix me: Explain usage of Cairo-Composite-Manager instead of XCompMgr.

[edit] xcompmgr

Warning: xcompmgr is a proof of concept application and is not meant for daily use. It is known to have memory leak issues, see bug 150348.
emerge -a xcompmgr

At this point we have all we need to enable drop shadows, cool "fade out" effects and real transparency. First we need to launch xcompmgr. From a console inside of X.Org do this:

xcompmgr -c

This will let you see the effects of running xcompmgr - if you don't like them, just type Ctrl+c from the console you are running xcompmgr in. If you do like them, type Ctrl+c and then:

xcompmgr -c &

The & asks xcompmgr to run in the background - when it's started this way you will have to use kill or killall to stop xcompmgr.

Note: Rather than doing Ctrl+c and killing the program you can also Crtl+z to suspend the program momentarily and type bg to put the process in the background without having to use &. Background jobs can be listed with the jobs command and killed with the kill %1 command where 1 is the number listed in the 'jobs' command output. Note that after suspending composite manager your screen will freeze until you type 'bg'.

This will enable xcompmgr with soft drop shadows turned on. You should now have happy little drop shadows on all your windows. You could optionally use the -s flag instead for hard shadows.

Here are some example settings for xcompmgr with shadow and fading,

xcompmgr -cCfF -r7 -o.65 -l-10 -t-8 -D7 &

To disable all of this after you have got it going, simply type this in a console,

killall xcompmgr

This will turn xcompmgr off, and disable all drop shadows and transparency settings.

[edit] transset

Note: You will need to have xcompmgr running for transset to work.

To enable transparent window, you'll need to tool x11-misc/transset,

emerge -a transset
Note: You will need to have xcompmgr running for transset to work.

Run in a terminal,

transset

Now your cursor will have changed, simply click on the window you want to make see through. You can also pass transset a value to define how transparent to make the windows, where 0 is fully transparent and 1 is fully opaque. Try:

transset .2

[edit] transset-df

Note: You will need to have xcompmgr running for transset-df to work.

If you don't want to wait and transset is not too handy for you, you can use x11-misc/transset-df,

emerge -a transset-df

Then, you can use keyboard or mouse shortcuts to set the transparency value to the focused windows.

The scroll wheel method can be realized via xbindkeys.

emerge -a xbindkeys
File: ~/.xbindkeysrc
"transset-df --min 0.1 -p --dec 0.2"
 control + b:4
"transset-df -p --inc 0.1"
 control + b:5

This way you can adjust the transparency of any window dynamically.

[edit] Troubleshooting

[edit] Performance

To increase performance, add to your /etc/X11/xorg.conf,

File: /etc/X11/xorg.conf
Section "Device"
    ...
    Option "RenderAccel" "True"
EndSection
Note: Acceleration currently does not work if Nvidia TwinView is being used.

Another preformance tip is enabling Backing Store, add to your /etc/X11/xorg.conf,

File: /etc/X11/xorg.conf
Section "ServerLayout"
    ...
    Option "BackingStore" "True"
EndSection

When enabled, you will find the following lines in your xorg log file /var/log/Xorg.0.log:

File: /var/log/Xorg.0.log
(**) (0): Option "BackingStore" "true"
(**) (0): Backing store enabled"

This option is used to enable the server's support for backing store, a mechanism by which pixel data for occluded window regions is remembered by the server thereby alleviating the need to send expose events to X clients when the data needs to be redisplayed. This can significantly increase performance.

Do not enable BackingStore with KDE 4.x, X server will crash!

Personal tools
In other languages