[xmonad] Using sakura with xmonad

Adam Sjøgren asjo at koldfront.dk
Sat Nov 21 21:16:28 UTC 2015


Brandon writes:

> On Wed, Jun 3, 2015 at 5:06 PM, Adam Sjøgren wrote:

>> The sakura windows automatically get a thin transparent border with
>> XMonad, through which my desktop background image shows.

> https://code.google.com/p/xmonad/issues/detail?id=581

So I tried looking into this, being a newbie at Haskell and X11
programming.

What it looks like to me, from the C-code needed in dwm in the issue
above, is to try and look up the normal border color and the focused
border color in the colormap of the window, instead of using the values
found in the default color map.

Ok, so how to do this? It looks like I can just change the two lines in
the windows function in Operations.hs that set the border:

    whenJust (W.peek old) $ \otherw -> io $ setWindowBorder d otherw nbc

     [...]

    whenJust (W.peek ws) $ \w -> io $ setWindowBorder d w fbc

Now, nbc and fbc are Pixels that are looked up in the default color map
once, so they need to be replaced with Pixels looked up in the color map
of the window (otherw or w).

Good, so looking at the C-code, the color map of the window is found by
asking the window's attributes, and grabbing it from there, and
allocNamedColor then can be called with that color map and the name of
the color, getting back an XColor, from which a pixel can be extracted.

But, hm, when I look at getWindowAttributes:

 * http://hackage.haskell.org/package/X11-1.4.0/docs/Graphics-X11-Xlib-Extras.html#v%3AgetWindowAttributes

it returns IO WindowAttributes, but they do not include a color map
entry:

 * http://hackage.haskell.org/package/X11-1.4.0/docs/Graphics-X11-Xlib-Extras.html#t%3AWindowAttributes

Hm. So, this is where I got to.

Any tips?


  Best regards,

    Adam

-- 
 "I'm a driver, I'm a winner, things are gonna change,        Adam Sjøgren
  I can feel it."                                        asjo at koldfront.dk



More information about the xmonad mailing list