diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-12-22 05:45:14 +0100 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-12-22 05:45:14 +0100 |
commit | 72a56badd40e6fa5bda64d4fb282ce6d7810c963 (patch) | |
tree | d39558cb7fdeb6add19a5cb5d9611538de5eb5aa /XMonad/Util | |
parent | 3fd1c1a11415ef36409445e6257be649eea22228 (diff) | |
download | XMonadContrib-72a56badd40e6fa5bda64d4fb282ce6d7810c963.tar.gz XMonadContrib-72a56badd40e6fa5bda64d4fb282ce6d7810c963.tar.xz XMonadContrib-72a56badd40e6fa5bda64d4fb282ce6d7810c963.zip |
Generalize XSelection functions to MonadIO
darcs-hash:20071222044514-a5988-ae8ce172dc6ea85798147292601467a3aecdab82.gz
Diffstat (limited to 'XMonad/Util')
-rw-r--r-- | XMonad/Util/XSelection.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/XMonad/Util/XSelection.hs b/XMonad/Util/XSelection.hs index 0ee1987..2ca2f28 100644 --- a/XMonad/Util/XSelection.hs +++ b/XMonad/Util/XSelection.hs @@ -57,8 +57,8 @@ import XMonad.Util.Run (safeSpawn, unsafeSpawn) -- | Returns a String corresponding to the current mouse selection in X; if there is none, an empty string is returned. Note that this is -- really only reliable for ASCII text and currently escapes or otherwise mangles more complex UTF-8 characters. -getSelection :: IO String -getSelection = do +getSelection :: MonadIO m => m String +getSelection = io $ do dpy <- openDisplay "" let dflt = defaultScreen dpy rootw <- rootWindow dpy dflt @@ -80,8 +80,8 @@ getSelection = do else destroyWindow dpy win >> return "" -- | Set the current X Selection to a given String. -putSelection :: String -> IO () -putSelection text = do +putSelection :: MonadIO m => String -> m () +putSelection text = io $ do dpy <- openDisplay "" let dflt = defaultScreen dpy rootw <- rootWindow dpy dflt |