Xlib Window Transparency

How to set the transparency opacity of a window with Xlib.

Set the _NET_WM_WINDOW_OPACITY property to an integer between 0x0 and 0xffffffff
An example function to set the opacity of a window using Xlib and python:

from Xlib import Xatom
def setOpacity(self, display, window, opacity):
if 0.0 < = opacity <= 1.0: real_opacity = int(opacity * 0xffffffff) window.change_property( display.get_atom('_NET_WM_WINDOW_OPACITY'), Xatom.CARDINAL, 32, [real_opacity,], ) else: return [/sourcecode] For this to work however, a composite manager of some kind must be running, but

Xlib Window Transparency

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s