arbtt 0.4.2 → 0.4.3
raw patch · 4 files changed
+32/−6 lines, 4 files
Files
- arbtt.cabal +1/−1
- doc/arbtt.xml +10/−1
- src/Capture.hs +19/−2
- src/Graphics/X11/XScreenSaver.hsc +2/−2
arbtt.cabal view
@@ -1,5 +1,5 @@ name: arbtt-version: 0.4.2+version: 0.4.3 license: GPL license-file: LICENSE category: Desktop
doc/arbtt.xml view
@@ -615,7 +615,7 @@ <varlistentry> <term><option>-r</option> <replaceable>RATE</replaceable></term> <term><option>--rate</option> <replaceable>RATE</replaceable></term>- <listitem><simpara>set the sample rate in seconds (default: 60)</simpara></listitem>+ <listitem><simpara>sets the sample rate in seconds (default: 60)</simpara></listitem> </varlistentry> </variablelist> </refsect1>@@ -813,6 +813,15 @@ <para> The version history with changes relevant for the user are documented here. </para>++ <sect2>+ <title>Version 0.4.3</title>+ <itemizedlist>+ <listitem>+ <para>Use fetchName from xmonad instead of xFetchName, as it works with unicode characters in window titles.</para>+ </listitem>+ </itemizedlist>+ </sect2> <sect2> <title>Version 0.4.2</title>
src/Capture.hs view
@@ -5,8 +5,9 @@ import Graphics.X11.Xlib.Extras import Graphics.X11.XScreenSaver (getXIdleTime) import Control.Monad-import Data.Maybe+import Control.Exception (bracket) import Control.Applicative+import Data.Maybe import Data.Time.Clock import System.IO @@ -35,7 +36,7 @@ return $ CaptureData winData it getWindowTitle :: Display -> Window -> IO String-getWindowTitle dpy = fmap (fromMaybe "") . fetchName dpy+getWindowTitle dpy = myFetchName dpy getProgramName :: Display -> Window -> IO String getProgramName dpy = fmap resName . getClassHint dpy@@ -48,3 +49,19 @@ | otherwise = do (r,p,_) <- queryTree dpy w if p == 0 then return w else go p ++-- | better than fetchName from X11, as it supports _NET_WM_NAME and unicode+--+-- Code taken from XMonad.Managehook.title+myFetchName :: Display -> Window -> IO String+myFetchName d w = do+ let getProp =+ (internAtom d "_NET_WM_NAME" False >>= getTextProperty d w)+ `catch`+ (\_ -> getTextProperty d w wM_NAME)++ extract prop = do l <- wcTextPropertyToTextList d prop+ return $ if null l then "" else head l++ bracket getProp (xFree . tp_value) extract `catch` \_ -> return ""+
src/Graphics/X11/XScreenSaver.hsc view
@@ -2,8 +2,8 @@ -------------------------------------------------------------------- -- | -- Module : Graphics.X11.XScreenSaver--- Copyright : (c) Haskell.org, 2009--- License : BSD3+-- Copyright : (c) Joachim Breitner+-- License : GPL2 -- -- Maintainer: Joachim Breitner <mail@joachim-breitner.de> -- Stability : provisional