summaryrefslogtreecommitdiffstats
path: root/src/Graphics/X11/Xlib/Extras/Extra.hs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2022-04-05 21:39:55 +0200
committertv <tv@krebsco.de>2022-04-05 22:06:40 +0200
commitf4cdf79bd4a75e9eafe68b9a908f4cc68682b7ef (patch)
treed2cb50df2344d97042b2c006ee39811e2b87511d /src/Graphics/X11/Xlib/Extras/Extra.hs
parent032cb86ff8108eb4915a692015da344a41f78506 (diff)
boom
Diffstat (limited to 'src/Graphics/X11/Xlib/Extras/Extra.hs')
-rw-r--r--src/Graphics/X11/Xlib/Extras/Extra.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Graphics/X11/Xlib/Extras/Extra.hs b/src/Graphics/X11/Xlib/Extras/Extra.hs
new file mode 100644
index 0000000..d88bf9d
--- /dev/null
+++ b/src/Graphics/X11/Xlib/Extras/Extra.hs
@@ -0,0 +1,14 @@
+module Graphics.X11.Xlib.Extras.Extra where
+
+import Data.Text (Text)
+import Foreign.C.String.Extra (castCCharToWord8)
+import qualified Data.ByteString as ByteString
+import qualified Data.Text.Encoding.Extra as Text
+import qualified Graphics.X11 as X11
+import qualified Graphics.X11.Xlib.Extras as X11
+
+
+getWindowPropertyText :: X11.Display -> X11.Atom -> X11.Window -> IO (Maybe Text)
+getWindowPropertyText d a w =
+ fmap (Text.decodeUtf8Lenient . ByteString.pack . map castCCharToWord8) <$>
+ X11.getWindowProperty8 d a w