[Xmonad] darcs patch: add XSelection.hs

Andrea Rossato mailing_list at istitutocolli.org
Fri Sep 14 12:52:10 EDT 2007


On Sat, Sep 15, 2007 at 09:07:01AM -0400, Gwern Branwen wrote:
> So I said I'd send in Andrea's X selection stuff when 0.3 was finalized and XMonadContrib/ opened up again. Here it is! I hope someone besides myself finds it useful.

I'm thinking about some improvements that probably should be provided
before pushing this patch (the same applies to Hxsel, the companion of
this piece of code):

> +-----------------------------------------------------------------------------
> +-- |
> +-- Module      :  XMonadContrib.XSelection
> +-- Copyright   :  (C) 2007 Andrea Rossato

we should at least share the copyright...;-)


> +  ty <- internAtom dpy "UTF8_STRING" False

this should be protected with a `catch` \_ -> internAtom dpy "sTRING"
False, or even better, falling back first to COMPOUND_TEXT and then to
string, right? Just in case UTF8_STRING is not present.

> +{- UTF-8 decoding for internal use in getSelection. This code is totally stolen from Eric Mertens's utf-string library
[...]
> +decode :: [Word8] -> String

I may be wrong but there should be an accepted patch to x11-extras
that provides the function needed here, but, I repeat it, I cuold be
plainly wrong.

Cheers,
Andrea



More information about the Xmonad mailing list