Created
March 6, 2017 20:08
-
-
Save sgf-dma/a609f855bbacf1a0292e660c32a5a04e to your computer and use it in GitHub Desktop.
fix-mupdf-fullscreen-xmonad.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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