[xmonad] Looking for "runOrKill" function

Brandon Allbery allbery.b at gmail.com
Wed Sep 24 16:32:09 UTC 2014


On Wed, Sep 24, 2014 at 11:57 AM, Sepp Tannhuber <sepp.tannhuber at yahoo.de>
wrote:

> My `additionalKeys` section of xmonad.hs has this key binding:
> ((mod3Mask, xK_d),               raiseMaybe (runInTerm "-title calendar
> -hold -geometry 105x12+0+25" "task calendar") (title =? "calendar"))
>
> I would like to replace the raiseMaybe by something like runOrKill. This
> means, it should run the terminal with title "calendar" if it's not yet
> running. Otherwise it should kill the terminal. How can I do that? Is it
> possible at all?
>

    raiseAndDo (runInTerm "-title calendar -hold -geometry 105x12+0+25"
"task calendar") (title =? "calendar")) killWindow

Although I wonder if you'd be better served by making it a NamedScratchpad
instead.

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20140924/97eff9db/attachment.html>


More information about the xmonad mailing list