Joined: 11 Sep 2008
|Posted: Thu 10 Oct 2013, 21:36 Post subject:
Simple way to draw a rectangle at higher level?
My window manager is Ratpoison, a light, configurable tiling manager, that I find ideal for me. However, it lacks a feature that would be very nice: showing with a rectangle which window is currently selected, when you have a mosaic of several of them.
Ratpoison allows interactive commands from keyboard (my configuration file is full of calls to small bash scripts); also, it has features that allow you to get the dimension in pixels of the current window, and its X11 window ID. Having those parameters, I thought it would not be difficult making a small program that draws a rectangle for the current window, calling it every time there is a change.
I'm thinking of something very quick and dirty, the next thing more refined than drawing the rectangle yourself with a crayon on the screen. However, I've been reading the documentation on X11, xlib and the like, and I find it all awfully complicated. I wonder if someone knows of some simple program that could receive the dimensions of the rectangle (and a configurable color, ideally), and do the dirty job with X. I can program in Bash, but if it has to be in C, and it is simple enough, I've been thinking of learning it for some time and maybe this could be the occasion to start. Thank you if you know of some resource or can help.