diff options
Diffstat (limited to 'lib/Graphics/X11/EWMH.hs')
-rw-r--r-- | lib/Graphics/X11/EWMH.hs | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/Graphics/X11/EWMH.hs b/lib/Graphics/X11/EWMH.hs index 4f539ad..210d1bf 100644 --- a/lib/Graphics/X11/EWMH.hs +++ b/lib/Graphics/X11/EWMH.hs @@ -4,16 +4,15 @@ module Graphics.X11.EWMH ) where import Control.Applicative ((<|>)) -import Data.Text (Text) +import Data.List.Extra (split) import Foreign.C.Types (CLong) import Graphics.X11.EWMH.Atom import Graphics.X11.Types (Window) import Graphics.X11.Xlib.Atom.Extra import Graphics.X11.Xlib.Display (defaultRootWindow) import Graphics.X11.Xlib.Extras (getWindowProperty32) -import Graphics.X11.Xlib.Extras.Extra (getWindowPropertyText) +import Graphics.X11.Xlib.Extras.Extra (getWindowPropertyString) import Graphics.X11.Xlib.Types (Display) -import qualified Data.Text as Text getActiveWindow :: Display -> IO (Maybe Window) @@ -29,11 +28,11 @@ getCurrentDesktop dpy = getWindowProperty32 dpy _WIN_WORKSPACE w where w = defaultRootWindow dpy -getDesktopNames :: Display -> IO (Maybe [Text]) +getDesktopNames :: Display -> IO (Maybe [String]) getDesktopNames dpy = do - (fmap (init . Text.split (=='\NUL')) <$>) $ - getWindowPropertyText dpy _NET_DESKTOP_NAMES w <|> - getWindowPropertyText dpy _WIN_WORKSPACE_NAMES w + (fmap (init . split (=='\NUL')) <$>) $ + getWindowPropertyString dpy _NET_DESKTOP_NAMES w <|> + getWindowPropertyString dpy _WIN_WORKSPACE_NAMES w where w = defaultRootWindow dpy getWindowDesktop :: Display -> Window -> IO (Maybe CLong) @@ -42,7 +41,7 @@ getWindowDesktop dpy w = getWindowProperty32 dpy _NET_WM_DESKTOP w <|> getWindowProperty32 dpy _WIN_WORKSPACE w -getWindowTitle :: Display -> Window -> IO (Maybe Text) +getWindowTitle :: Display -> Window -> IO (Maybe String) getWindowTitle dpy w = - getWindowPropertyText dpy _NET_WM_NAME w <|> - getWindowPropertyText dpy _WM_NAME w + getWindowPropertyString dpy _NET_WM_NAME w <|> + getWindowPropertyString dpy _WM_NAME w |