Skip to content

Instantly share code, notes, and snippets.

@slackcals
slackcals / when.hs
Created January 24, 2019 18:36
How to use "when"
-- from: https://mail.haskell.org/pipermail/xmonad/2009-May/007979.html
logHook = ...other stuff... >> checkKBLayout
...
checkKBLayout :: X ()
checkKBLayout = do
curTag <- gets (W.currentTag . windowset)
when (curTag == "foo") $ spawn "set keyboard layout"
--
-- Is there a more efficient/elegant way to do this?
--
-- Objective: To disable/enable the mouse cursor for specific windows
--
...
...
checkMouseDisable :: X ()
checkMouseDisable = do