Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Accessing the Root Window in Perl

by itodd (Acolyte)
on May 24, 2003 at 02:58 UTC ( #260521=perlquestion: print w/replies, xml ) Need Help??

itodd has asked for the wisdom of the Perl Monks concerning the following question:

My mail notification utility (Lily: Yet Another New Mail Notification Utility) sure would look neat if I could somehow access the root window to obtain the pixmap so I could have the background be transparent.

Does anyone know if this is possible?

Replies are listed 'Best First'.
Re: Accessing the Root Window in Perl
by hossman (Prior) on May 24, 2003 at 03:58 UTC

    I don't believe X11 provides any means for Clients to ask the server for any information about any window -- including the root window. That's why "Eterm" requires that your either use Enlightenment as your windows manager, or set the background with "Esetroot" if you want any level of transparency. This gives Eterm something to query to find out what pixels are where in the root window.

    I can't seem to find any docs mentioning an API to allow arbitrary programs to query Enlightenment/Esetroot for the background info, but i didn't look too hard so that doesn't mean it doesn't exist.

    You could allways write your own wrapper script for setting the background image (using xv, or what have you) and making a symlink to the last file used to set the background that your other scritps can allways refrence when they want to know what the background is.

      I don't believe X11 provides any means for Clients to ask the server for any information about any window

      Sure it does. Ever used xmag? Or a graphics editor like xpaint that allows you to pick the colour of any pixel on the screen? xli or xloadimage, that can inspect or share colour palettes already in use (important in the time X-servers often used 256 colour palettes)? fvwm2 has no problem using partially transparent icons; and if I view a partially transparent gif with display (which comes with ImageMagick), I get to see what's underneath (and even the focus goes to the underlaying application). And you may be familiar with xscreensaver which has a few screensavers that use the current display.

      You can say a lot of bad things about X, that it's slow, that it uses a lot of memory, that it's insecure, and that it's hard to program with. But the one reason that it's still going strong is that anything is possible. And that includes transparency, and inspecting the pixels of other applications. But I'm not an X-windows programmer (it's been more than 10 years since I last wrote an X-windows program (in C, pure, raw X-windows, no widget sets used)), so how it's done, I do not know.


      Multi Gnome Terminal allows transparent background with any (gnome-compliant?) window manager (I use it with sawfish). So, even though I have no further information, I think that at least under GNOME there's a standard API to query for backgorund information.


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://260521]
Approved by blokhead
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2022-08-15 21:30 GMT
Find Nodes?
    Voting Booth?

    No recent polls found