[xmonad] Re: Cannot manage windows by title

Alexey Feigin mysteriousentity at gmail.com
Tue Sep 15 07:55:54 EDT 2009


2009/9/15 Alexey Feigin <mysteriousentity at gmail.com>

> 2009/9/15 Alexey Feigin <mysteriousentity at gmail.com>
>
>> Hi,
>>
>> I would like to manage some windows depending on their *title* (WM_NАМЕ).
>> I wrote a manage hook but it doesn't seem to be working (ie, the action is
>> not performed).
>>
>> Matching by *className* and *resource* seems to work, but not by *title*.
>>
>> myManageHook = composeAll . concat $
>>    [ [ fmap ("Gvim"        `isInfixOf`) className --> doFloat ]  -- Works
>>    , [ fmap ("gvim"        `isInfixOf`) resource  --> doFloat ]  -- Works
>>    , [ fmap ("journal.txt" `isInfixOf`) title     --> doFloat ]  -- Does
>> not work
>>    ]
>>
>> I also tried to use
>> (stringProperty "WM_NAME")
>>
>> Any ideas?
>>
>> I'm running xmonad with GNOME on Ubuntu.
>>
>> Thanks in advance :)
>>
>> Alexey
>>
>
> I looked at the source of ManageHook and saw that *title* actually takes
> _NET_WM_NAME if it exists. In the case of the gvim window I want to detect,
> this property is in UTF8. Could that be why it's not matching up? And if so,
> what can I do about it?
>
> Alexey
>

I write my own version of *title* based on that of ManageHook's. This one
doesn't check _NET_WM_NAME but just goes for WM_NAME straight away.

---
myTitle :: Query String
myTitle = ask >>= \w -> liftX $ do
    d <- asks display
   let
       getProp = getTextProperty d w wM_NAME
       extract = fmap head . wcTextPropertyToTextList d
   io $ bracket getProp (xFree . tp_value) extract `catch` \_ -> return ""
---

Still doesn't work.

Alexey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/xmonad/attachments/20090915/86fcfb54/attachment.html


More information about the xmonad mailing list