module XMonad.Util.NoTaskbar (
noTaskbar
,markNoTaskbar) where
import XMonad.Core
import XMonad.ManageHook
import Graphics.X11.Xlib (Window)
import Graphics.X11.Xlib.Atom (aTOM)
import Graphics.X11.Xlib.Extras (changeProperty32
,propModePrepend)
import Control.Monad.Reader (ask)
noTaskbar :: ManageHook
noTaskbar = ask >>= (>> idHook) . liftX . markNoTaskbar
markNoTaskbar :: Window -> X ()
markNoTaskbar w = withDisplay $ \d -> do
ws <- getAtom "_NET_WM_STATE"
ntb <- getAtom "_NET_WM_STATE_SKIP_TASKBAR"
npg <- getAtom "_NET_WM_STATE_SKIP_PAGER"
io $ changeProperty32 d w ws aTOM propModePrepend [fi ntb,fi npg]
fi :: (Integral i, Num n) => i -> n
fi = fromIntegral