module XMonad.Util.NoTaskbar (
noTaskbar
,markNoTaskbar) where
import XMonad.Core
import XMonad.Prelude (fi)
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 :: Query (Endo WindowSet)
noTaskbar = forall r (m :: * -> *). MonadReader r m => m r
ask forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> forall m. Monoid m => m
idHook) forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. X a -> Query a
liftX forall b c a. (b -> c) -> (a -> b) -> a -> c
. Atom -> X ()
markNoTaskbar
markNoTaskbar :: Window -> X ()
markNoTaskbar :: Atom -> X ()
markNoTaskbar Atom
w = forall a. (Display -> X a) -> X a
withDisplay forall a b. (a -> b) -> a -> b
$ \Display
d -> do
Atom
ws <- String -> X Atom
getAtom String
"_NET_WM_STATE"
Atom
ntb <- String -> X Atom
getAtom String
"_NET_WM_STATE_SKIP_TASKBAR"
Atom
npg <- String -> X Atom
getAtom String
"_NET_WM_STATE_SKIP_PAGER"
forall (m :: * -> *) a. MonadIO m => IO a -> m a
io forall a b. (a -> b) -> a -> b
$ Display -> Atom -> Atom -> Atom -> CInt -> [CLong] -> IO ()
changeProperty32 Display
d Atom
w Atom
ws Atom
aTOM CInt
propModePrepend [forall a b. (Integral a, Num b) => a -> b
fi Atom
ntb,forall a b. (Integral a, Num b) => a -> b
fi Atom
npg]