[SOLVED] How Do I Draw To Part Of The Root Window, Leaving The Rest Of It Unchanged?
Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How Do I Draw To Part Of The Root Window, Leaving The Rest Of It Unchanged?
Esteemed Colleagues:
How do I draw an image to part of the root window, leaving the rest of the root window unchanged? Yes, I know I could write a program that does that, but there should be an existing program capable of doing it.
The scenario is a computer connected to two monitors, and xrandr has placed one to the right of the other. In the general case the two monitors will have different sizes, let us say $H1 and $W1 are the dimensions of the first monitor, and $H2 and $W2 are the dimensions of the second monitor. I want to draw an image to the 2nd monitor's root window without changing the 1st monitor's root window. The command
will draw the image onto the 2nd monitor's root window, but it will replace the 1st monitor's root window with solid black. I want to leave the 1st monitor's root window unchanged. The solution does not have to use the display program; it can be xsetroot or xv or any standard program. I would also be satisfied with a Perl/Tk script.
Thank you in advance for any and all replies.
I'd go at replicating what occurs when you pick a window by it's title bar with a mouse and move it left/right. From the software perspective, left and right are one big virtual screen.
I thought a lot of that zooming/replicating/resizing stuff was handled in the GPU.
How do I draw an image to part of the root window, leaving the rest of the root window unchanged? Yes, I know I could write a program that does that, but there should be an existing program capable of doing it.
The scenario is a computer connected to two monitors, and xrandr has placed one to the right of the other. In the general case the two monitors will have different sizes, let us say $H1 and $W1 are the dimensions of the first monitor, and $H2 and $W2 are the dimensions of the second monitor. I want to draw an image to the 2nd monitor's root window without changing the 1st monitor's root window. The command
will draw the image onto the 2nd monitor's root window, but it will replace the 1st monitor's root window with solid black. I want to leave the 1st monitor's root window unchanged. The solution does not have to use the display program; it can be xsetroot or xv or any standard program. I would also be satisfied with a Perl/Tk script.
Thank you in advance for any and all replies.
Some *setroot programs used to be able to do sth like that. imlibsetroot iirc, maybe also hsetroot or 'setroot'.
Or conky.
Some *setroot programs used to be able to do sth like that. imlibsetroot iirc, maybe also hsetroot or 'setroot'.
Or conky.
The setroot program comes closest to what I asked for -- thank you for telling me about it -- but it does not do quite what I asked for (unless it can be done with some undocumented or poorly documented feature). The setroot command can be used to draw an image onto the first monitor's background, and to simultaneously draw a different image onto the second monitor's background, and it works well even when the two monitors have different sizes, and different aspect ratios. But if you try to set the background of only one of the monitors, the other monitor's background turns to solid black. I still do not see a way of changing one monitor's background, while leaving the other monitor unaffected.
But if you try to set the background of only one of the monitors, the other monitor's background turns to solid black. I still do not see a way of changing one monitor's background, while leaving the other monitor unaffected.
I thought about this after I posted.
All the setroots will have this drawback afaics; you will have to tell it to redraw both screens even when changing only one.
Conky can do exactly what you want but I'd consider it extremely hackish in this situation. It is good though for drawing logos on your background etc.
1. It seems that you cannot get conky to draw on the root window. When it detects that it is being asked to draw on a root window, it creates another window -- above the root window, although below all the other windows -- on which to draw. It is able to get the window manager (if there is a window manager running) to leave this window undecorated, so it looks like it is drawing on the root window. My reason for thinking that it is actually drawing on its own window -- even when I explicitly set "own_window" to "false" in the conky configuration file -- is that when conky exits, this window disappears, and the former contents of the root window reappear. So I would have to keep conky running indefinitely; I cannot ask it to draw on the root window, and then exit. Okay, I can live with that. I am not happy about it, but I can live with it. However,
2. The program is (please forgive me for saying this) poorly documented, and amazingly complex. Scanning the documentation quickly, or even slowly, does not inform me of any way I can use this program to draw an image on a window. I think it would take me about a month to become proficient in this program, if all I have are the documentation and my own resources. I hate saying this, because I hate when other people say this, but, even though this program is documented, or purports to be documented, I could use some help from someone who is already proficient in its use. If I have $H1 and $W1 as the height and width of the first monitor (I don't think I need $H1) and $H2 and $W2 as the height and width of the second monitor, and bg.png as the name of the image file that I want to draw on the second monitor's background, without changing the first monitor's background, how do I use conky to do this? Thank you in advance for any and all replies.
After re-reading the conky documentation one more time, and seeing the "image" command which somehow I had failed to see before, I figured out how to do it with conky (make sure "own_window" is set to "false" in the configuration file):
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.