Skip to content

Instantly share code, notes, and snippets.

@slackcals
Created January 28, 2019 20:18
Show Gist options
  • Save slackcals/5e84ee60ba36bd8e00cc2bf8b859f7e5 to your computer and use it in GitHub Desktop.
Save slackcals/5e84ee60ba36bd8e00cc2bf8b859f7e5 to your computer and use it in GitHub Desktop.
--
-- Is there a more efficient/elegant way to do this?
--
-- Objective: To disable/enable the mouse cursor for specific windows
--
...
...
checkMouseDisable :: X ()
checkMouseDisable = do
curTag <- gets (W.currentTag . windowset)
when ( curTag == "1:main") $ spawn "xinput --disable 11"
when ( curTag == "2:extra_terminals") $ spawn "xinput --disable 11"
when ( curTag == "3:browser") $ spawn "xinput --disable 11"
when ( curTag == "4") $ spawn "xinput --disable 11"
when ( curTag == "5:mail") $ spawn "xinput --enable 11"
when ( curTag == "6") $ spawn "xinput --disable 11"
when ( curTag == "7") $ spawn "xinput --disable 11"
when ( curTag == "8") $ spawn "xinput --disable 11"
when ( curTag == "9:float") $ spawn "xinput --enable 11
...
...
myConfig = desktopConfig
{
...
...
, logHook = updatePointer (0.50, 0.50) (1, 1)
>> checkMouseDisable
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment