codehenry / xmonad

Automatically exported from code.google.com/p/xmonad
0 stars 0 forks source link

clearUrgency should be exported from XMonad.Hooks.UrgencyHook #533

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

I was trying to make it such that windows which are banished off screen on 
hidden scratch pad workspaces *never* get urgency set. It was not possible to 
do so without making my own Urgency Hook, which was fine, except that in order 
to make it I had no choice but to modify the source and add clearUrgency to the 
export list.  Since "clearUrgents" is exported, which just applies 
"clearUrgency" to all windows, I don't see why the latter shouldn't also be 
available.

    data FilterUrgencyHook = FilterUrgencyHook [String]

    instance UrgencyHook FilterUrgencyHook where
        urgencyHook (FilterUrgencyHook skips) w = do
            ws <- gets windowset
            case W.findTag w ws of
                Just tag -> when (tag `elem` skips) (clearUrgency w)
                _ -> return ()

Original issue reported on code.google.com by JohnTy...@gmail.com on 19 Feb 2013 at 7:36

GoogleCodeExporter commented 8 years ago
This patch just adds clearUrgency to the export list.

Original comment by JohnTy...@gmail.com on 23 Sep 2013 at 3:12

Attachments:

GoogleCodeExporter commented 8 years ago
A patch for #1 is now in the official repo. We could add this function to the 
module too, if you think that would be useful.

filterUrgencyHook skips w = do
            ws <- gets windowset
            case W.findTag w ws of
                Just tag -> when (tag `elem` skips) (clearUrgency w)
                _ -> return ()

Original comment by vogt.a...@gmail.com on 23 Sep 2013 at 3:17

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
That would be good, yeah. Would that imply that I no longer need to implement 
the UrgencyHook instance as I did above?

Original comment by JohnTy...@gmail.com on 23 Sep 2013 at 4:14

GoogleCodeExporter commented 8 years ago
There is an instance UrgencyHook (Window -> X ()). Previously you had to write 
a separate data&instance for each urgencyhook. This is no longer the case 
because the urgencyhook doesn't have to be stored in a layout anymore (due to 
the addition of the handleEventHook a couple years back). 

Original comment by vogt.a...@gmail.com on 23 Sep 2013 at 11:58

GoogleCodeExporter commented 8 years ago
This sounds good. Sorry to be a tool, but what does that imply for my config?

For example if it looked like this before
        xmonad $ ewmh $ withUrgencyHook (FilterUrgencyHook ["NSP", "SP"]) defaultConfig

then I'd expect something like....

        xmonad $ ewmh $ withUrgencyHook (filterUrgencyHook ["NSP", "SP"]) defaultConfig

now? Also, when (roughly) can I expect this to hit a stable release? I'm using 
the latest release from xmonad.org but not darcs.

Original comment by JohnTy...@gmail.com on 24 Sep 2013 at 10:09

GoogleCodeExporter commented 8 years ago
You're exactly right.

A release won't happen for a several months I expect. Or it might be sooner if 
ghc-7.8 breaks things.

Original comment by vogt.a...@gmail.com on 24 Sep 2013 at 10:33

GoogleCodeExporter commented 8 years ago
You're exactly right. Taking a closer look it seems like filtering might be 
better off done in the UrgencyConfig but I will leave things as-is for now.

A release won't happen for a several months I expect. Or it might be sooner if 
ghc-7.8 breaks things.

As for trying it out, you can `cabal install 
http://code.haskell.org/xmonad/xmonad.tar.gz 
http://code.haskell.org/XMonadContrib/XMonadContrib.tar.gz', if darcs is too 
much trouble.

Original comment by vogt.a...@gmail.com on 24 Sep 2013 at 10:53