[xmonad] Using sakura with xmonad

Adam Sjøgren asjo at koldfront.dk
Sun Nov 22 03:12:48 UTC 2015


Adam writes:

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

[...]

> I have tried to make a pull request for adding this field now:
>
>  * https://github.com/xmonad/X11/pull/35

It turns out that to make use of the new wa_colormap field, I need to
change getWindowAttributes to throw an exception if
XGetWindowAttributes() fails. So:

 * https://github.com/asjo/X11/commit/e5421307a02ea0cadcb381d282615d56a0e848c0

Then, to make xmonad-contrib compile, XMonad/Util/DebugWindow.hs needs
adjusting:

 * https://github.com/asjo/xmonad-contrib/commit/e775872ac34c81e070e530a89f591e08bd2b7c8a

And finally, I can change XMonad/Operations.hs to grab the color from
the window's color map if available (it isn't when closing a window, so
it is important to check the return value of XGetWindowAttributes() to
avoid a crash - I had fun logging myself out when closing a window for a
while!):

 * https://github.com/asjo/xmonad/commit/e7d0e004d0a1acfd1ff149eaabf274fe2519c4fc

... mimicking the change done to dwm¹.

>From testing it a couple of minutes, it works on my machine - the
transparent borders are gone from my Sakura windows, and the solid
colour I configured in XMonad is used instead.

Note thet especially the changes to XMonad/Operations.hs are in "try and
try pounding at it again until it works"-style code, and any tips on how
to write it better will be much appreciated.


  Best regards,

    Adam


¹ https://github.com/chjj/compton/issues/240#issuecomment-62245919

-- 
 "God must've been punting angels left and right."            Adam Sjøgren
                                                         asjo at koldfront.dk



More information about the xmonad mailing list