module XMonad.Util.Cursor
(
module Graphics.X11.Xlib.Cursor,
setDefaultCursor
) where
import Graphics.X11.Xlib.Cursor
import XMonad
setDefaultCursor :: Glyph -> X ()
setDefaultCursor :: Glyph -> X ()
setDefaultCursor Glyph
glyph = do
Display
dpy <- (XConf -> Display) -> X Display
forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
asks XConf -> Display
display
Window
rootw <- (XConf -> Window) -> X Window
forall r (m :: * -> *) a. MonadReader r m => (r -> a) -> m a
asks XConf -> Window
theRoot
IO () -> X ()
forall a. IO a -> X a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> X ()) -> IO () -> X ()
forall a b. (a -> b) -> a -> b
$ do
Window
curs <- Display -> Glyph -> IO Window
createFontCursor Display
dpy Glyph
glyph
Display -> Window -> Window -> IO ()
defineCursor Display
dpy Window
rootw Window
curs
Display -> IO ()
flush Display
dpy
Display -> Window -> IO ()
freeCursor Display
dpy Window
curs