Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fix-mupdf-fullscreen-xmonad.hs
import Data.Maybe
import Control.Monad
import XMonad
import XMonad.Hooks.EwmhDesktops
addNETSupported :: Atom -> X ()
addNETSupported x = withDisplay $ \dpy -> do
r <- asks theRoot
a_NET_SUPPORTED <- getAtom "_NET_SUPPORTED"
a <- getAtom "ATOM"
liftIO $ do
sup <- (join . maybeToList) <$> getWindowProperty32 dpy a_NET_SUPPORTED r
when (fromIntegral x `notElem` sup) $
changeProperty32 dpy r a_NET_SUPPORTED a propModeAppend [fromIntegral x]
addEWMHFullscreen :: X ()
addEWMHFullscreen = do
wms <- getAtom "_NET_WM_STATE"
wfs <- getAtom "_NET_WM_STATE_FULLSCREEN"
mapM_ addNETSupported [wms, wfs]
main :: IO ()
main = xmonad . ewmh $ def
{ modMask = mod4Mask
, handleEventHook = fullscreenEventHook <+> handleEventHook def
, startupHook = startupHook def >> addEWMHFullscreen
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment