From marcus.uneson at gmail.com Fri Jan 27 15:18:37 2012 From: marcus.uneson at gmail.com (Marcus Uneson) Date: Fri, 27 Jan 2012 15:18:37 +0100 Subject: arbtt: window titles not captured (x/kubuntu 11.10 reps / cabal 0.6.1-2 / X11-1.5.0.0) Message-ID: Hi, arbtt seems to be a really excellent utility (so many thanks). I can't get it to work, however: window titles are not captured. wmctrl -l reports windows and titles, as expected. But titles are not logged: > arbtt-dump (...) TimeLogEntry {tlTime = 2012-01-27 13:56:36.698671 UTC, tlRate = 60000, tlData = CaptureData {cWindows = [(False,"","xfce4-panel"),(False,"","xfdesktop"),(False,"","xfce4-panel"),(False,"","xfce4-notes"),(False,"","xfce4-terminal"),(False,"","Navigator"),(False,"","xfce4-terminal"),(True,"","xfce4-terminal")], cLastActivity = 48}} TimeLogEntry {tlTime = 2012-01-27 13:57:36.804329 UTC, tlRate = 60000, tlData = CaptureData {cWindows = [(False,"","xfce4-panel"),(False,"","xfdesktop"),(False,"","xfce4-panel"),(False,"","xfce4-notes"),(False,"","xfce4-terminal"),(True,"","Navigator"),(False,"","xfce4-terminal"),(False,"","xfce4-terminal")], cLastActivity = 1666}} > strings ~/.arbtt/capture.log (...) kile gedit xfce4-panel xfdesktop xfce4-panel xfce4-notes xfce4-terminal Navigator I am on Xubuntu/Kubuntu 11.10. I tried installing latest version from the repositories, 0.6.1-2, (http://www.ubuntuupdates.org/package_metas?exact_match=1&q=arbtt) both on kde and xfce. The libghc6-x11-dev is 1.5 (http://www.ubuntuupdates.org/packages/show/337791) I also tried cabal install arbtt with ghc 6.10.4 and X11-1.5.0.0, same result. Ascii-only and unicode titles behave the same, i.e, neither http://yogan.meinungsverstaerker.de/tmp/titletest-ascii.html http://yogan.meinungsverstaerker.de/tmp/titletest-unicode.html are captured. LC_* is sv_SE.UTF8 or en_DK.UTF8 throughout The problem is probably related to this http://lists.nomeata.de/archive/arbtt/2010/000115.html but that discussion does not really report a conclusion. thanks for any suggestions, Marcus From mail at joachim-breitner.de Fri Jan 27 19:18:30 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Fri, 27 Jan 2012 18:18:30 +0000 Subject: arbtt: window titles not captured (x/kubuntu 11.10 reps / cabal 0.6.1-2 / X11-1.5.0.0) In-Reply-To: References: Message-ID: <1327688310.2447.9.camel@kirk> Dear Marcus, Am Freitag, den 27.01.2012, 15:18 +0100 schrieb Marcus Uneson: > thanks for any suggestions, thanks for your interest. Unfortunately, I?m not sure what the problem might be. Since you have recompiled arbtt yourself already, maybe you can play a bit with myFetchName in src/Capture/X11.hs. For replace the two occurrences of the empty string "" by something else ("dummy1", "dummy2") and see which one pops up. This would narrow down the causes. Greetings from Philadelphia, Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From mail at joachim-breitner.de Fri Jan 27 21:48:29 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Fri, 27 Jan 2012 20:48:29 +0000 Subject: arbtt: window titles not captured (x/kubuntu 11.10 reps / cabal 0.6.1-2 / X11-1.5.0.0) In-Reply-To: References: <1327688310.2447.9.camel@kirk> Message-ID: <1327697309.2447.13.camel@kirk> Hi, Am Freitag, den 27.01.2012, 20:37 +0100 schrieb Marcus Uneson: > (I skip ccing the list for this until we know more) hmm, I?d rather keep in on the list for future reference. > > > Since you have recompiled arbtt yourself already, maybe you can play a > > bit with myFetchName in src/Capture/X11.hs. For replace the two > > occurrences of the empty string "" by something else ("dummy1", > > "dummy2") and see which one pops up. This would narrow down the causes. > > Sure. If I replace > > 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 "" > > with > > 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 "empty" else head l > > bracket getProp (xFree . tp_value) extract `catch` \e -> > return ("exception: " ++ show e) > > > I get > > > arbtt-dump > (...) > TimeLogEntry {tlTime = 2012-01-27 19:28:28.271569 UTC, tlRate = 60000, > tlData = CaptureData {cWindows = [(False,"exception: user error > (wcTextPropertyToTextList)","xfce4-panel"),(False,"exception: user > error (wcTextPropertyToTextList)","xfce4-panel"),(False,"exception: > user error (wcTextPropertyToTextList)","xfdesktop"),(False,"exception: > user error (wcTextPropertyToTextList)","xfce4-notes"),(False,"exception: > user error (wcTextPropertyToTextList)","Navigator"),(True,"exception: > user error (wcTextPropertyToTextList)","xfce4-terminal")], > cLastActivity = 34}} > > I will be happy to help if you have further ideas. I know Haskell > reasonably well but nothing about xmonad or X11. ok, so the problem is that XmbTextListToTextProperty returns a non-zero value. The question is, which error is it. Unfortunately, this is not available in the X11 bindings. What you can do is to copy the relevant code from X11 http://hackage.haskell.org/packages/archive/X11/1.5.0.1/doc/html/src/Graphics-X11-Xlib-Extras.html#xwcTextPropertyToTextList (wcTextPropertyToTextList and xwcTextPropertyToTextList) and failIf from http://hackage.haskell.org/packages/archive/base/latest/doc/html/src/Foreign-Marshal-Error.html#throwIfNeg into the arbtt module and then modify failIf to include the error value in the exception. Thanks for helping out here, Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From marcus.uneson at gmail.com Fri Jan 27 22:53:52 2012 From: marcus.uneson at gmail.com (Marcus Uneson) Date: Fri, 27 Jan 2012 22:53:52 +0100 Subject: arbtt: window titles not captured (x/kubuntu 11.10 reps / cabal 0.6.1-2 / X11-1.5.0.0) In-Reply-To: <1327697309.2447.13.camel@kirk> References: <1327688310.2447.9.camel@kirk> <1327697309.2447.13.camel@kirk> Message-ID: >> (I skip ccing the list for this until we know more) > > hmm, I?d rather keep in on the list for future reference. OK, as you wish. With this diff for src/Capture/X11.hs $> diff X11-orig.hs X11.hs 5c5 < import Graphics.X11.Xlib.Extras --- > import Graphics.X11.Xlib.Extras hiding (wcTextPropertyToTextList) 12a13,14 > import Foreign > import Foreign.C.String 82c84 < return $ if null l then "" else head l --- > return $ if null l then "empty" else head l 84c86,101 < bracket getProp (xFree . tp_value) extract `catch` \_ -> return "" --- > bracket getProp (xFree . tp_value) extract `catch` \e -> return ("exception: " ++ show e) > > > wcTextPropertyToTextList :: Display -> TextProperty -> IO [String] > wcTextPropertyToTextList d prop = > alloca $ \listp -> > alloca $ \countp -> > with prop $ \propp -> do > throwIf (success >) (\e -> "wcTextPropertyToTextList: " ++ show e) $ > xwcTextPropertyToTextList d propp listp countp > count <- peek countp > list <- peek listp > texts <- flip mapM [0..fromIntegral count - 1] $ \i -> > peekElemOff list i >>= peekCWString > wcFreeStringList list > return texts > arbtt-dump TimeLogEntry {tlTime = 2012-01-27 21:39:55.733266 UTC, tlRate = 60000, tlData = CaptureData {cWindows = [(False,"exception: user error (wcTextPropertyToTextList: -2)","xfce4-panel"),(False,"exception: user error (wcTextPropertyToTextList: -2)","xfce4-panel"),(False,"exception: user error (wcTextPropertyToTextList: -2)","xfdesktop"),(False,"exception: user error (wcTextPropertyToTextList: -2)","xfce4-notes"),(False,"exception: user error (wcTextPropertyToTextList: -2)","Navigator"),(True,"exception: user error (wcTextPropertyToTextList: -2)","xfce4-terminal"),(False,"exception: user error (wcTextPropertyToTextList: -2)","gedit")], cLastActivity = 41}} I can experiment a bit further (e.g, throwIfNeg), but not tonight. Marcus From marcus.uneson at gmail.com Sat Jan 28 00:07:59 2012 From: marcus.uneson at gmail.com (Marcus Uneson) Date: Sat, 28 Jan 2012 00:07:59 +0100 Subject: arbtt: window titles not captured (x/kubuntu 11.10 reps / cabal 0.6.1-2 / X11-1.5.0.0) In-Reply-To: References: <1327688310.2447.9.camel@kirk> <1327697309.2447.13.camel@kirk> Message-ID: (continued anyway...) So the problem is error code -2, XLocaleNotSupported: http://www.unix.com/man-page/All/3x/XwcTextListToTextProperty/ >XmbTextListToTextProperty() > will not return XLocaleNotSupported if XSupportsLocale() has returned > True for the current locale. If we including that check in the diff $> diff X11-orig.hs X11.hs 5c5 < import Graphics.X11.Xlib.Extras --- > import Graphics.X11.Xlib.Extras hiding (wcTextPropertyToTextList) 12a13,14 > import Foreign > import Foreign.C.String 20a23,24 > loc <- supportsLocale > unless loc $ hPutStrLn stderr "arbtt [Warning]: locale unsupported" 82c86 < return $ if null l then "" else head l --- > return $ if null l then "empty" else head l 84c88,103 < bracket getProp (xFree . tp_value) extract `catch` \_ -> return "" --- > bracket getProp (xFree . tp_value) extract `catch` \e -> return ("exception" ++ show e) > > > wcTextPropertyToTextList :: Display -> TextProperty -> IO [String] > wcTextPropertyToTextList d prop = > alloca $ \listp -> > alloca $ \countp -> > with prop $ \propp -> do > throwIf (success >) (\e -> "wcTextPropertyToTextList: " ++ show e) $ > xwcTextPropertyToTextList d propp listp countp > count <- peek countp > list <- peek listp > texts <- flip mapM [0..fromIntegral count - 1] $ \i -> > peekElemOff list i >>= peekCWString > wcFreeStringList list > return texts then arbtt-capture does indeed complain: arbtt [Warning]: locale unsupported So it is clear what the error is. Does someone with more locale chops know what to do about it? cheers, Marcus From mail at joachim-breitner.de Sat Jan 28 04:50:31 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Sat, 28 Jan 2012 03:50:31 +0000 Subject: arbtt: window titles not captured (x/kubuntu 11.10 reps / cabal 0.6.1-2 / X11-1.5.0.0) In-Reply-To: References: <1327688310.2447.9.camel@kirk> <1327697309.2447.13.camel@kirk> Message-ID: <1327722631.2447.18.camel@kirk> Dear Marcus, Am Samstag, den 28.01.2012, 00:07 +0100 schrieb Marcus Uneson: > So the problem is error code -2, XLocaleNotSupported: > > http://www.unix.com/man-page/All/3x/XwcTextListToTextProperty/ > >[..] > > So it is clear what the error is. Does someone with more locale chops > know what to do about it? hmm, not really. I am using a similar locale (de_DE.utf8), so it is really strange that it fails for you. An alternative would be to use Xutf8TextPropertyToTextList instead, which does not depend on the current locale. Unfortunately, it is not provided by X11, so one would have to add it there; or add it in arbtt (which should be fine). Do you feel like trying that out? You?d need to copy foreign import ccall unsafe "XlibExtras.h XwcTextPropertyToTextList" xwcTextPropertyToTextList :: Display -> Ptr TextProperty -> Ptr (Ptr CWString) -> Ptr CInt -> IO CInt to your code as well, and then modify that to use Xutf8TextPropertyToTextList instead. Greetings, Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From marcus.uneson at gmail.com Sat Jan 28 11:47:01 2012 From: marcus.uneson at gmail.com (Marcus Uneson) Date: Sat, 28 Jan 2012 11:47:01 +0100 Subject: arbtt: window titles not captured (x/kubuntu 11.10 reps / cabal 0.6.1-2 / X11-1.5.0.0) In-Reply-To: <1327722631.2447.18.camel@kirk> References: <1327688310.2447.9.camel@kirk> <1327697309.2447.13.camel@kirk> <1327722631.2447.18.camel@kirk> Message-ID: Hi again, > An alternative would be to use Xutf8TextPropertyToTextList instead, > which does not depend on the current locale. hmm... oddly, the following fails in exactly the same way as before $> diff X11-orig.hs X11.hs 0a1,2 > {-# LANGUAGE ForeignFunctionInterface #-} > 5c7 < import Graphics.X11.Xlib.Extras --- > import Graphics.X11.Xlib.Extras hiding (wcTextPropertyToTextList) 12a15,17 > import Foreign > import Foreign.C > import Foreign.C.String 20a26,27 > loc <- supportsLocale > unless loc $ hPutStrLn stderr "arbtt [Warning]: locale unsupported" 82c89,92 < return $ if null l then "" else head l --- > return $ if null l then "empty" else head l > > bracket getProp (xFree . tp_value) extract `catch` \e -> return ("exception" ++ show e) > 84c94,111 < bracket getProp (xFree . tp_value) extract `catch` \_ -> return "" --- > wcTextPropertyToTextList :: Display -> TextProperty -> IO [String] > wcTextPropertyToTextList d prop = > alloca $ \listp -> > alloca $ \countp -> > with prop $ \propp -> do > throwIf (success >) (\e -> "wcTextPropertyToTextList: " ++ show e) $ > xutf8TextPropertyToTextList d propp listp countp > count <- peek countp > list <- peek listp > texts <- flip mapM [0..fromIntegral count - 1] $ \i -> > peekElemOff list i >>= peekCWString > wcFreeStringList list > return texts > > > foreign import ccall unsafe "XlibExtras.h Xutf8TextPropertyToTextList" > xutf8TextPropertyToTextList :: Display -> Ptr TextProperty -> Ptr (Ptr CWString) -> Ptr CInt -> IO CInt > Locales have always been a matter of trial-and-error to me, read and written in mysterious, poorly documented ways. In addition, it seems Ubuntu has slightly different ideas about their configuration than do its colleagues. To the best of my knowledge I have only used standard gui tools for configuring the locale settings, and I don't recall any previous problems on this machine, but I am beginning to suspect some misconfiguration anyway, external to arbtt. I can get to an unused machine later today;; I will install the same OS but with an unmixed, vanilla locale and see if that helps. Marcus From marcus.uneson at gmail.com Mon Jan 30 08:05:47 2012 From: marcus.uneson at gmail.com (Marcus Uneson) Date: Mon, 30 Jan 2012 08:05:47 +0100 Subject: arbtt: window titles not captured (x/kubuntu 11.10 reps / cabal 0.6.1-2 / X11-1.5.0.0) In-Reply-To: References: <1327688310.2447.9.camel@kirk> <1327697309.2447.13.camel@kirk> <1327722631.2447.18.camel@kirk> Message-ID: Hi again, Everything work as expected on a fresh Ubuntu install on another machine with locale en_DK.UTF-8. After removing non-en_DK packages on my own machine, copying /etc/default/locale and /etc/environment from the untouched system and running locale-gen, everything works there as well. I was unable to track down the precise problem and have now run out of motivation, but it seems that you can create conflicting locale definitions and live with them for quite a while before anyone notices. So, sorry for taking your time for an error which wasn't related to arbtt. Since I may not be world-unique in having misconfigured locales without knowing, you may wish to consider keeping a warning, perhaps 5c5 < import Graphics.X11.Xlib.Extras --- > import Graphics.X11.Xlib.Extras 20a21,22 > loc <- supportsLocale > unless loc $ hPutStrLn stderr "arbtt [Warning]: locale unsupported" cheers, Marcus From mail at joachim-breitner.de Mon Jan 30 17:33:38 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Mon, 30 Jan 2012 17:33:38 +0100 Subject: arbtt: window titles not captured (x/kubuntu 11.10 reps / cabal 0.6.1-2 / X11-1.5.0.0) In-Reply-To: References: <1327688310.2447.9.camel@kirk> <1327697309.2447.13.camel@kirk> <1327722631.2447.18.camel@kirk> Message-ID: <1327941218.2578.1.camel@kirk> Dear Marcus, Am Montag, den 30.01.2012, 08:05 +0100 schrieb Marcus Uneson: > Everything work as expected on a fresh Ubuntu install > on another machine with locale en_DK.UTF-8. > After removing non-en_DK packages on my own machine, > copying /etc/default/locale and /etc/environment > from the untouched system and running locale-gen, > everything works there as well. > > I was unable to track down the precise problem and have now > run out of motivation, > but it seems that you can create conflicting locale definitions and live with > them for quite a while before anyone notices. > So, sorry for taking your time for an error which wasn't > related to arbtt. glad you figured it out, and don?t worry about taking my time; I am happy to hear that people use arbtt. > Since I may not be world-unique in having misconfigured locales > without knowing, you may wish to consider keeping a warning, perhaps > > 5c5 > < import Graphics.X11.Xlib.Extras > --- > > import Graphics.X11.Xlib.Extras > 20a21,22 > > loc <- supportsLocale > > unless loc $ hPutStrLn stderr "arbtt [Warning]: locale unsupported" > Thanks, I applied that to the repo, it will be included with the next release (whenever that might be :-)). enjoy arbtt (and make sure you don?t share your capture file ;-)), Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From ryan at spacecoaster.org Mon Feb 27 21:13:02 2012 From: ryan at spacecoaster.org (Ryan Lovett) Date: Mon, 27 Feb 2012 21:13:02 +0100 Subject: arbtt, process accounting Message-ID: <20120227193700.GA14056@spacecoaster.org> Hello, Have you considered using Linux's BSD process accounting as an additional data source? The actual CPU user time might be relevant to what you're doing. ("how busy was this application when I was using it?") Ryan From mail at joachim-breitner.de Mon Feb 27 21:16:07 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Mon, 27 Feb 2012 21:16:07 +0100 Subject: arbtt, process accounting In-Reply-To: <20120227193700.GA14056@spacecoaster.org> References: <20120227193700.GA14056@spacecoaster.org> Message-ID: <1330373767.20408.4.camel@kirk> Hello Ryan, I hope you don?t mind moving this discussion to the arbtt mailing list. Am Montag, den 27.02.2012, 11:37 -0800 schrieb Ryan Lovett: > Have you considered using Linux's BSD process accounting as an additional > data source? The actual CPU user time might be relevant to what you're > doing. ("how busy was this application when I was using it?") I did not think about this yet. It should be possible (although one first has to figure out a way to map windows to process IDs), but I?m not entirely sure about the usefulness of the data. Can you describe a more concrete usecase? (I?ll be traveling this week, so my replies might come late.) Greetings, Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From ryan at spacecoaster.org Tue Feb 28 20:14:14 2012 From: ryan at spacecoaster.org (Ryan Lovett) Date: Tue, 28 Feb 2012 11:14:14 -0800 Subject: arbtt, process accounting In-Reply-To: <1330373767.20408.4.camel@kirk> References: <20120227193700.GA14056@spacecoaster.org> <1330373767.20408.4.camel@kirk> Message-ID: <20120228191414.GB23941@spacecoaster.org> On Mon, Feb 27, 2012 at 09:16:07PM +0100, Joachim Breitner wrote: > Am Montag, den 27.02.2012, 11:37 -0800 schrieb Ryan Lovett: > > Have you considered using Linux's BSD process accounting as an additional > > data source? The actual CPU user time might be relevant to what you're > > doing. ("how busy was this application when I was using it?") > > I did not think about this yet. It should be possible (although one > first has to figure out a way to map windows to process IDs), but I?m > not entirely sure about the usefulness of the data. Can you describe a > more concrete usecase? Well process accounting directly tracks user processes. The kernel's pacct file will contain the actual CPU time and memory usage of all applications started by users. In doesn't know about what the processes are specifically doing, just how hard they worked. You might choose to augment or vet the data collected by arbtt with this kernel data. Ryan From thimmyb at hotmail.com Thu Mar 29 16:28:38 2012 From: thimmyb at hotmail.com (Thimmy Bagfelt) Date: Thu, 29 Mar 2012 15:28:38 +0100 Subject: Keep up the good work! Message-ID: Hi, I just want to show my appreciation for arbtt. I'm not a programmer so I can't help developing it, and I even found it difficult to use a software without GUI. I hope you keep working on this. Thank you for making my life easier ! RegardsThimmy Bagfelt -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at joachim-breitner.de Thu Mar 29 17:04:38 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Thu, 29 Mar 2012 17:04:38 +0200 Subject: Keep up the good work! In-Reply-To: References: Message-ID: <1333033478.5221.9.camel@kirk> Hi Thimmy, Am Donnerstag, den 29.03.2012, 15:28 +0100 schrieb Thimmy Bagfelt: > I just want to show my appreciation for arbtt. I'm not a programmer so > I can't help developing it, and I even found it difficult to use a > software without GUI. I hope you keep working on this. Thank you for > making my life easier ! thanks for your feedback. I don?t really know whether arbtt has users besides me, how many there are and what they do with it. Hence, messages like yours are important. I don?t expect I?ll find the time to develop a nice GUI for it any time soon, though. Greetings, Joachim -- Joachim Breitner e-Mail: mail at joachim-breitner.de Homepage: http://www.joachim-breitner.de Jabber-ID: nomeata at joachim-breitner.de -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From ttimo at ttimo.net Thu Mar 29 18:10:38 2012 From: ttimo at ttimo.net (Timothee Besset) Date: Thu, 29 Mar 2012 11:10:38 -0500 Subject: Fwd: Keep up the good work! In-Reply-To: References: <1333033478.5221.9.camel@kirk> Message-ID: (meant to post to the list) ---------- Forwarded message ---------- From: Timothee Besset Date: Thu, Mar 29, 2012 at 11:10 AM Subject: Re: Keep up the good work! To: Joachim Breitner I use it as well, it's a nifty little tool. Have 2+ years worth of data into the log file, takes a few minutes to process. It doesn't quite capture all I would want it to capture, but that may be because I haven't invested the effort in completing the setup. Namely, the google chrome page: gmail/reddit/slashdot etc., identifying the program running in the terminal (emacs), identifying to which hosts I'm ssh'ed to. And identifying what I'm running in wine. Still, for the things it captures for me already, it's really good. TTimo On Thu, Mar 29, 2012 at 10:04 AM, Joachim Breitner wrote: > Hi Thimmy, > > Am Donnerstag, den 29.03.2012, 15:28 +0100 schrieb Thimmy Bagfelt: > >> I just want to show my appreciation for arbtt. I'm not a programmer so >> I can't help developing it, and I even found it difficult to use a >> software without GUI. I hope you keep working on this. Thank you for >> making my life easier ! > > thanks for your feedback. I don?t really know whether arbtt has users > besides me, how many there are and what they do with it. Hence, messages > like yours are important. > > I don?t expect I?ll find the time to develop a nice GUI for it any time > soon, though. > > Greetings, > Joachim > > -- > Joachim Breitner > ?e-Mail: mail at joachim-breitner.de > ?Homepage: http://www.joachim-breitner.de > ?Jabber-ID: nomeata at joachim-breitner.de > > _______________________________________________ > arbtt mailing list > arbtt at lists.nomeata.de > http://lists.nomeata.de/mailman/listinfo/arbtt > From ttimo at ttimo.net Thu Mar 29 18:19:38 2012 From: ttimo at ttimo.net (Timothee Besset) Date: Thu, 29 Mar 2012 18:19:38 +0200 Subject: Keep up the good work! In-Reply-To: <1333033478.5221.9.camel@kirk> References: <1333033478.5221.9.camel@kirk> Message-ID: I use it as well, it's a nifty little tool. Have 2+ years worth of data into the log file, takes a few minutes to process. It doesn't quite capture all I would want it to capture, but that may be because I haven't invested the effort in completing the setup. Namely, the google chrome page: gmail/reddit/slashdot etc., identifying the program running in the terminal (emacs), identifying to which hosts I'm ssh'ed to. And identifying what I'm running in wine. Still, for the things it captures for me already, it's really good. TTimo On Thu, Mar 29, 2012 at 10:04 AM, Joachim Breitner wrote: > Hi Thimmy, > > Am Donnerstag, den 29.03.2012, 15:28 +0100 schrieb Thimmy Bagfelt: > >> I just want to show my appreciation for arbtt. I'm not a programmer so >> I can't help developing it, and I even found it difficult to use a >> software without GUI. I hope you keep working on this. Thank you for >> making my life easier ! > > thanks for your feedback. I don?t really know whether arbtt has users > besides me, how many there are and what they do with it. Hence, messages > like yours are important. > > I don?t expect I?ll find the time to develop a nice GUI for it any time > soon, though. > > Greetings, > Joachim > > -- > Joachim Breitner > ?e-Mail: mail at joachim-breitner.de > ?Homepage: http://www.joachim-breitner.de > ?Jabber-ID: nomeata at joachim-breitner.de > > _______________________________________________ > arbtt mailing list > arbtt at lists.nomeata.de > http://lists.nomeata.de/mailman/listinfo/arbtt > From mail at joachim-breitner.de Thu Mar 29 18:20:41 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Thu, 29 Mar 2012 18:20:41 +0200 Subject: Keep up the good work! In-Reply-To: References: <1333033478.5221.9.camel@kirk> Message-ID: <1333038041.5221.10.camel@kirk> Hi, Am Donnerstag, den 29.03.2012, 18:19 +0200 schrieb Timothee Besset: > I use it as well, it's a nifty little tool. Have 2+ years worth of > data into the log file, takes a few minutes to process. compiling it with GHC 7.4.1 speed that up quite a bit, but you need to take the code from Darcs, I did not yet get around to do a release. Enjoy, Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From joker at someserver.de Mon Apr 23 01:01:21 2012 From: joker at someserver.de (JOKer) Date: Mon, 23 Apr 2012 01:01:21 +0200 Subject: Should arbtt still be working with i3 window manager? Message-ID: <4F948DC1.7000900@someserver.de> Hi. I've read in the release notes of 0.4.1, that arbtt should be/has been usable with i3: > In the absence of _NET_CLIENT_LIST, look for application windows as > children of the root windows. This should work for users of window > managers like i3 without EWHM support. If this should still be the case, I'd like to know what I'm doing wrong. I'm only getting output like this from arbtt-dump: TimeLogEntry {tlTime = 2012-04-22 22:30:16.254658 UTC, tlRate = 60000, tlData = CaptureData {cWindows = [], cLastActivity = 581}} TimeLogEntry {tlTime = 2012-04-22 22:31:16.265074 UTC, tlRate = 60000, tlData = CaptureData {cWindows = [], cLastActivity = 47}} If not, is there a way to make it work again (other than hacking EWHM support into i3)? I'd really like to try this program. Have a nice day anyway, JOKer From mail at joachim-breitner.de Mon Apr 23 14:50:34 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Mon, 23 Apr 2012 14:50:34 +0200 Subject: Should arbtt still be working with i3 window manager? In-Reply-To: <4F948DC1.7000900@someserver.de> References: <4F948DC1.7000900@someserver.de> Message-ID: <1335185434.4443.9.camel@kirk> Dear JOKer, Am Montag, den 23.04.2012, 01:01 +0200 schrieb JOKer: > I've read in the release notes of 0.4.1, that arbtt should be/has been > usable with i3: > > In the absence of _NET_CLIENT_LIST, look for application windows as > > children of the root windows. This should work for users of window > > managers like i3 without EWHM support. > > If this should still be the case, I'd like to know what I'm doing wrong. > I'm only getting output like this from arbtt-dump: > TimeLogEntry {tlTime = 2012-04-22 22:30:16.254658 UTC, tlRate = 60000, > tlData = CaptureData {cWindows = [], cLastActivity = 581}} > TimeLogEntry {tlTime = 2012-04-22 22:31:16.265074 UTC, tlRate = 60000, > tlData = CaptureData {cWindows = [], cLastActivity = 47}} > > If not, is there a way to make it work again (other than hacking EWHM > support into i3)? I'd really like to try this program. Hmm, looking at the code I don?t think this works any more. I?m happy to add working support for i3, as long as someone provides me with a patch :-) The patch that should have added this functionality is [Be smarter when figuring out what window is active Joachim Breitner **20090928181800 Ignore-this: 83d2e4798327b65d9678d8dc64c071f7 Thanks to CJ van den Berg for the investigation. ] hunk ./src/Capture.hs 22 - (fwin,_) <- getInputFocus dpy + (fsubwin,_) <- getInputFocus dpy + fwin <- followTreeUntil dpy (`elem` cwins) fsubwin + hunk ./src/Capture.hs 38 +-- | Follows the tree of windows up until the condition is met or the window is +-- a direct child of the root. +followTreeUntil :: Display -> (Window -> Bool) -> Window -> IO Window [_$_] +followTreeUntil dpy cond = go + where go w | cond w = return w + | otherwise = do (r,p,_) <- queryTree dpy w + if r == p then return w + else go p [_$_] + And this probably broke it: [Fix possible cause for crashes Joachim Breitner **20091008173228 Ignore-this: f051cdb62c622e441b69946343ab8aab ] hunk ./src/Capture.hs 38 --- | Follows the tree of windows up until the condition is met or the window is --- a direct child of the root. +-- | Follows the tree of windows up until the condition is met or the root +-- window is reached. hunk ./src/Capture.hs 44 - if r == p then return w + if p == 0 then return w But I don?t recall why the original code crashed... Greetings, Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From joker at someserver.de Tue Apr 24 00:58:45 2012 From: joker at someserver.de (JOKer) Date: Tue, 24 Apr 2012 00:58:45 +0200 Subject: Should arbtt still be working with i3 window manager? In-Reply-To: <1335185434.4443.9.camel@kirk> References: <4F948DC1.7000900@someserver.de> <1335185434.4443.9.camel@kirk> Message-ID: <4F95DEA5.5030604@someserver.de> On 23/04/12 14:50, Joachim Breitner wrote: > Dear JOKer, > > Am Montag, den 23.04.2012, 01:01 +0200 schrieb JOKer: >> I've read in the release notes of 0.4.1, that arbtt should be/has been >> usable with i3: >>> In the absence of _NET_CLIENT_LIST, look for application windows as >>> children of the root windows. This should work for users of window >>> managers like i3 without EWHM support. >> >> If this should still be the case, I'd like to know what I'm doing wrong. >> I'm only getting output like this from arbtt-dump: >> TimeLogEntry {tlTime = 2012-04-22 22:30:16.254658 UTC, tlRate = 60000, >> tlData = CaptureData {cWindows = [], cLastActivity = 581}} >> TimeLogEntry {tlTime = 2012-04-22 22:31:16.265074 UTC, tlRate = 60000, >> tlData = CaptureData {cWindows = [], cLastActivity = 47}} >> >> If not, is there a way to make it work again (other than hacking EWHM >> support into i3)? I'd really like to try this program. > > Hmm, looking at the code I don?t think this works any more. I?m happy to > add working support for i3, as long as someone provides me with a > patch :-) > > The patch that should have added this functionality is > > [Be smarter when figuring out what window is active > Joachim Breitner **20090928181800 > Ignore-this: 83d2e4798327b65d9678d8dc64c071f7 > > Thanks to CJ van den Berg for the investigation. > ] hunk ./src/Capture.hs 22 > - (fwin,_) <- getInputFocus dpy > + (fsubwin,_) <- getInputFocus dpy > + fwin <- followTreeUntil dpy (`elem` cwins) fsubwin > + > hunk ./src/Capture.hs 38 > +-- | Follows the tree of windows up until the condition is met or the window is > +-- a direct child of the root. > +followTreeUntil :: Display -> (Window -> Bool) -> Window -> IO Window [_$_] > +followTreeUntil dpy cond = go > + where go w | cond w = return w > + | otherwise = do (r,p,_) <- queryTree dpy w > + if r == p then return w > + else go p [_$_] > + > > And this probably broke it: > > [Fix possible cause for crashes > Joachim Breitner **20091008173228 > Ignore-this: f051cdb62c622e441b69946343ab8aab > ] hunk ./src/Capture.hs 38 > --- | Follows the tree of windows up until the condition is met or the window is > --- a direct child of the root. > +-- | Follows the tree of windows up until the condition is met or the root > +-- window is reached. > hunk ./src/Capture.hs 44 > - if r == p then return w > + if p == 0 then return w > > But I don?t recall why the original code crashed... > > Greetings, > Joachim > Hi Joachim, thanks for the pointer. I've tried to figure it out and came to (a hacky) solution. It is definitely not a proper patch, but I'll post it anyway for reference. First of all I really don't know haskell, x11 protocol and not even how to compile that program properly, but debian packages help a lot with the third part. So please excuse me, if this is ugly from the language view - I really can't tell. Now to my solution. The problem is, that i3 does not support _NET_CLIENT_LIST and because of that, no windows will be found and this means, nothing will ever get written to the log file if I interpreted that code line correctly: winData <- forM wins $ \w -> (,,) This is why I created a new list with just the focused window in it, since that window will always be found. This means, the tagging cannot be as powerful, but most of the tagging is done on the active window anyway. This part could probably even be commited, if done properly (if list.empty() then list = [fwin]) but as I said, my haskell is not good enough for this. After I got it "working" I still needed to change the followTreeUntil function. Your commit concerning the crash fix in followTreeUntil makes a difference in just "i3" as window name and "[i3 con] container for 0x1237112" when reverted. Since i3 can have many containers in each other, I check for this string in the title and stop at the window right before it. This might not be very efficient and also adds another dependency, but it makes the program useable. So thanks again for the prompt reply and have a nice day, JOKer Index: arbtt-0.6.2/src/Capture/X11.hs =================================================================== --- arbtt-0.6.2.orig/src/Capture/X11.hs 2012-04-07 16:29:41.000000000 +0200 +++ arbtt-0.6.2/src/Capture/X11.hs 2012-04-24 00:04:45.730446886 +0200 @@ -1,6 +1,7 @@ module Capture.X11 where import Data +import Data.List.Utils import Graphics.X11 import Graphics.X11.Xlib.Extras import Control.Monad @@ -45,7 +46,7 @@ (fsubwin,_) <- getInputFocus dpy fwin <- followTreeUntil dpy (`elem` wins) fsubwin - winData <- forM wins $ \w -> (,,) + winData <- forM [fwin] $ \w -> (,,) (w == fwin) <$> (T.pack <$> getWindowTitle dpy w) <*> (T.pack <$> getProgramName dpy w) @@ -68,7 +69,10 @@ where go w | cond w = return w | otherwise = do (r,p,_) <- queryTree dpy w if p == 0 then return w - else go p + else do + title <- getWindowTitle dpy p + if startswith "[i3 con]" title == True then return w + else go p -- | better than fetchName from X11, as it supports _NET_WM_NAME and unicode -- Index: arbtt-0.6.2/arbtt.cabal =================================================================== --- arbtt-0.6.2.orig/arbtt.cabal 2012-04-23 20:12:06.034237419 +0200 +++ arbtt-0.6.2/arbtt.cabal 2012-04-23 23:48:38.462432372 +0200 @@ -31,7 +31,7 @@ hs-source-dirs: src build-depends: base == 4.5.*, filepath, directory, mtl, time, utf8-string, - bytestring, binary, deepseq + bytestring, binary, deepseq, MissingH other-modules: Data Data.MyText From info at gratis-steam-spiele.net Thu May 24 03:44:54 2012 From: info at gratis-steam-spiele.net (Steam) Date: Wed, 23 May 2012 21:44:54 -0400 (EDT) Subject: Gratis Steam Spiele! Message-ID: <1579906965.2712851.1337823894903.JavaMail.root@engine56.emailserving.com> GRATIS STEAM SPIELE GIBT ES NUR HIER! Daf?r musst du nicht viel tun - einfach nur den Link verbreiten. Sobald du die n?tige Klickzahl erreicht hast, wird dir der jeweilige Aktivierungscode im Feld unten angezeigt. http://www.Gratis-Steam-Spiele.net HIER FINDEST DU ALLE N?TIGEN INFOS! BILD TITEL SCAN VOM AKTIVIERUNGSCODE BEN?TIGTE KLICKS Counter-Strike: Source 0/15 Dota 2 Beta 0/20 Counter-Strike: Global Offensive Beta 0/25 Portal 2 0/30 Sid Meier's Civilization V 0/35 Call of Duty: Modern Warfare 3 0/40 The Elder Scrolls V: Skyrim 0/45 Steam Spiel deiner Wahl* 0/50 -.- http://www.anjiejie.com/unsubscribe.php?nid=1&e=arbtt at lists.nomeata.de&advertiser_id=3954&list_id=7104 Ons adres: Gassenweg 44 Essen, Nordrhein-Westfalen 45257 Copyright (C) 2012 Steam Inc. All rights reserved. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gwern0 at gmail.com Sat Sep 15 01:19:43 2012 From: gwern0 at gmail.com (Gwern Branwen) Date: Fri, 14 Sep 2012 19:19:43 -0400 Subject: arbtt feedback Message-ID: So it occurred to me I should give some feedback. I currently have 2 major issues with arbtt: 1) the performance is terrible. Parsing my 81M of logs takes gigabytes of memory; it's so bad that it kills running programs like Firefox. I have to run with +RTS options just to get a result. And it doesn't help to specify '$sampleage < 24:00', that's just as bad - even though one would expect it to since it should be able to only parse a few kb at the end of the file! What's laziness for if you're going to analyze the entire database... 2) the config language is highly repetitious. When I look at my config (which cribs heavily from the example config in the docs), I see tons of verbosity. Consider these basic rules: current window $program == "Navigator" || current window $program == "chromium" || current window $program == "epiphany-browser" || current window $title =~ /elinks.*/ ==> tag WWW, current window $program == "evince" || current window $program == "FBReader" || current window $program == "calibre" || current window $program == "gscan2pdf" || current window $title =~ /.*pager.*/ || current window $title =~ m!/doc.*! ==> tag PDF, current window $title =~ /.*mplayer.*/ || current window $program == "Audacity" || current window $program == "clementine" || current window $program == "puddletag" || current window $title =~ /.*YouTube.*/ || current window $title =~ /.*Vocaloid.*/ || current window $title =~ m!.*/r/vocaloid/.*! ==> tag Music, -- gwern http://www.gwern.net From gwern0 at gmail.com Mon Sep 17 00:12:04 2012 From: gwern0 at gmail.com (Gwern Branwen) Date: Sun, 16 Sep 2012 18:12:04 -0400 Subject: arbtt feedback In-Reply-To: <1347822043.4398.19.camel@kirk> References: <1347704167.4115.13.camel@kirk> <1347790801.4398.6.camel@kirk> <1347822043.4398.19.camel@kirk> Message-ID: On Sun, Sep 16, 2012 at 3:00 PM, Joachim Breitner wrote: > Have you tried dist-upgrade? (I am part of the Debian team that > maintains ghc, so I?m interested in user reports). Nah. Recompiling everything I use is a waste of time unless I'm actually developing something, so I put it off as long as possible. -- gwern http://www.gwern.net From gwern0 at gmail.com Sat Sep 15 20:22:49 2012 From: gwern0 at gmail.com (Gwern Branwen) Date: Sat, 15 Sep 2012 14:22:49 -0400 Subject: arbtt feedback In-Reply-To: <1347704167.4115.13.camel@kirk> References: <1347704167.4115.13.camel@kirk> Message-ID: On Sat, Sep 15, 2012 at 6:16 AM, Joachim Breitner wrote: > thanks for your feedback. Do you mind moving this to > arbtt at lists.nomeata.de? I'm not subscribed, so... > Do you have it compiled with ghc 7.4? Performance has improved a lot > since then ? I analyze my 40MB of logs in 20 seconds using 1616MB of > memory. But surely it can do better; when I wrote arbtt I did know much > less about Haskell performance than I do now. Also the internal data > structure keeps references to the future and the past (the plan was that > the config language can also query that), but that prevents the GC from > throwing out a lot of things. I'm using whatever Debian testing has: 0.6.2-1 & ghc 7.0.4. > This is a valid request. Currently, the system makes no assumption of > the ordering of entries in the file. Some code that checks for > $sampleage relations and fast-forwards the log file to the right > position might help (although it still needs to be read linearly, as > there is no seek information and the records are of varying length). I'd expect just some sort of filter would give the right behavior - 'filter (userInput) $ parse $ read file' if you follow me. with $sampleage, this ought to throw out every entry until it hits <24:00 ago and then the filter starts returning some entries. > Ok, that should be fixable easy by allowing a list of values on the RHS > of a == or =~. Is this what you would want to use? I *think* that should work. > Oh, and while I am at it I implemented "... == [ "x", "y", "z"]" and > "... =~ [ m!regex1!, m!regex2!]" support. Do you want to test it from > http://darcs.nomeata.de/arbtt/ or should I just release it? I can't compile it - src/Data.hs spits an error: src/Data.hs:31:34: Could not deduce (NFData UTCTime) arising from a use of `deepseq' from the context (NFData a) bound by the instance declaration at src/Data.hs:30:10-44 Possible fix: add (NFData UTCTime) to the context of the instance declaration or add an instance declaration for (NFData UTCTime) In the first argument of `deepseq', namely `a `deepseq` b' In the first argument of `deepseq', namely `a `deepseq` b `deepseq` c' In the expression: a `deepseq` b `deepseq` c `deepseq` () cabal: Error: some packages failed to install: arbtt-0.6.3 failed during the building phase. The exception was: ExitFailure 1 -- gwern http://www.gwern.net From gwern0 at gmail.com Sun Sep 16 19:54:48 2012 From: gwern0 at gmail.com (Gwern Branwen) Date: Sun, 16 Sep 2012 13:54:48 -0400 Subject: arbtt feedback In-Reply-To: <1347790801.4398.6.camel@kirk> References: <1347704167.4115.13.camel@kirk> <1347790801.4398.6.camel@kirk> Message-ID: On Sun, Sep 16, 2012 at 6:20 AM, Joachim Breitner wrote: > that?s ok; but I?d like to have such discussion archived. Let me > rephrase the question: Do you mind if I forward (i.e. redirect) this > thread to the list as well? You do not have to subscribe. I don't mind. > GHC in testing is at 7.4. But 0.6.2-1 should have been compiled with > that. /shrug When I run update && upgrade, GHC is in the kept back list so far. > I looked at the code again and the problem is that it currently keeps > track of the whole list for several reasons: > * There can be multiple report being processed. > * Some global data (i.e. total number of records) is calculated first > and then shared between possibly multiple report passes. > * Some reports also refer to the non-selected time (?% of total time > selected?). So making arbtt-stats O(1) is a non-trivial refactoring. Why would either of the latter two force retention of the full dataset? An integer counter like 'total number of records' should be computable without retaining the list, and likewise integer counters for selected or non-selected time. > You need time >= 1.4 (which should come with GHC 7.4); I fixed the cabal > file accordingly. Well, I'll try again when Debian decides it's safe to upgrade. Until then, it's not *that* much of a priority - I'll only really need the arbtt data in March when my big experiment concludes. -- gwern http://www.gwern.net From mail at joachim-breitner.de Sat Sep 15 12:16:07 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Sat, 15 Sep 2012 12:16:07 +0200 Subject: arbtt feedback In-Reply-To: References: Message-ID: <1347704167.4115.13.camel@kirk> Hi Gwern, . thanks for your feedback. Do you mind moving this to arbtt at lists.nomeata.de? Am Freitag, den 14.09.2012, 19:19 -0400 schrieb Gwern Branwen: > So it occurred to me I should give some feedback. I currently have 2 > major issues with arbtt: > > 1) the performance is terrible. Parsing my 81M of logs takes gigabytes > of memory; it's so bad that it kills running programs like Firefox. I > have to run with +RTS options just to get a result. Do you have it compiled with ghc 7.4? Performance has improved a lot since then ? I analyze my 40MB of logs in 20 seconds using 1616MB of memory. But surely it can do better; when I wrote arbtt I did know much less about Haskell performance than I do now. Also the internal data structure keeps references to the future and the past (the plan was that the config language can also query that), but that prevents the GC from throwing out a lot of things. > And it doesn't > help to specify '$sampleage < 24:00', that's just as bad - even though > one would expect it to since it should be able to only parse a few kb > at the end of the file! What's laziness for if you're going to analyze > the entire database... This is a valid request. Currently, the system makes no assumption of the ordering of entries in the file. Some code that checks for $sampleage relations and fast-forwards the log file to the right position might help (although it still needs to be read linearly, as there is no seek information and the records are of varying length). > 2) the config language is highly repetitious. When I look at my config > (which cribs heavily from the example config in the docs), I see tons > of verbosity. Consider these basic rules: > > current window $program == "Navigator" || current window $program > == "chromium" || current window $program == "epiphany-browser" || > current window $title =~ /elinks.*/ ==> tag WWW, > current window $program == "evince" || current window $program == > "FBReader" || current window $program == "calibre" || current window > $program == "gscan2pdf" || current window $title =~ /.*pager.*/ || > current window $title =~ m!/doc.*! ==> tag PDF, > current window $title =~ /.*mplayer.*/ || current window $program > == "Audacity" || current window $program == "clementine" || current > window $program == "puddletag" || current window $title =~ > /.*YouTube.*/ || current window $title =~ /.*Vocaloid.*/ || current > window $title =~ m!.*/r/vocaloid/.*! ==> tag Music, Ok, that should be fixable easy by allowing a list of values on the RHS of a == or =~. Is this what you would want to use? About the performance issues... I?d like to improve the situation, but I don?t know when I can do that. Ok, I am just looking for low hanging fruit and a carefully placed deepseq gets memory consumption down to 874M :-) Removing the future/past feature strangely does not help. I guess that is because Data.Binary.Get is strict. Oh, and while I am at it I implemented "... == [ "x", "y", "z"]" and "... =~ [ m!regex1!, m!regex2!]" support. Do you want to test it from http://darcs.nomeata.de/arbtt/ or should I just release it? Greetings from ICFP, Joachim -- Joachim Breitner e-Mail: mail at joachim-breitner.de Homepage: http://www.joachim-breitner.de Jabber-ID: nomeata at joachim-breitner.de -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From mail at joachim-breitner.de Sun Sep 16 21:00:43 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Sun, 16 Sep 2012 21:00:43 +0200 Subject: arbtt feedback In-Reply-To: References: <1347704167.4115.13.camel@kirk> <1347790801.4398.6.camel@kirk> Message-ID: <1347822043.4398.19.camel@kirk> Hi, Am Sonntag, den 16.09.2012, 13:54 -0400 schrieb Gwern Branwen: > > GHC in testing is at 7.4. But 0.6.2-1 should have been compiled with > > that. > > /shrug > > When I run update && upgrade, GHC is in the kept back list so far. Have you tried dist-upgrade? (I am part of the Debian team that maintains ghc, so I?m interested in user reports). > > I looked at the code again and the problem is that it currently keeps > > track of the whole list for several reasons: > > * There can be multiple report being processed. > > * Some global data (i.e. total number of records) is calculated first > > and then shared between possibly multiple report passes. > > * Some reports also refer to the non-selected time (?% of total time > > selected?). So making arbtt-stats O(1) is a non-trivial refactoring. > > Why would either of the latter two force retention of the full > dataset? An integer counter like 'total number of records' should be > computable without retaining the list, and likewise integer counters > for selected or non-selected time. Yes, each individual value could be calculated lazily, but not first one and then the other. This is basically the same problem as in let xs = [1..100000000] in (last xs, length xs) I could, for each traversal, re-open the file, re-parse it and lazily process it. Or I could manually merge the various computations into one fold, but that looks tedious. I should look what support libraries like iteratee provide for that. Greetings, Joachim -- Joachim Breitner e-Mail: mail at joachim-breitner.de Homepage: http://www.joachim-breitner.de Jabber-ID: nomeata at joachim-breitner.de -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From mail at joachim-breitner.de Sun Sep 16 12:20:01 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Sun, 16 Sep 2012 12:20:01 +0200 Subject: arbtt feedback In-Reply-To: References: <1347704167.4115.13.camel@kirk> Message-ID: <1347790801.4398.6.camel@kirk> Hi Gwern, Am Samstag, den 15.09.2012, 14:22 -0400 schrieb Gwern Branwen: > On Sat, Sep 15, 2012 at 6:16 AM, Joachim Breitner > wrote: > > thanks for your feedback. Do you mind moving this to > > arbtt at lists.nomeata.de? > > I'm not subscribed, so... that?s ok; but I?d like to have such discussion archived. Let me rephrase the question: Do you mind if I forward (i.e. redirect) this thread to the list as well? You do not have to subscribe. > > Do you have it compiled with ghc 7.4? Performance has improved a lot > > since then ? I analyze my 40MB of logs in 20 seconds using 1616MB of > > memory. But surely it can do better; when I wrote arbtt I did know much > > less about Haskell performance than I do now. Also the internal data > > structure keeps references to the future and the past (the plan was that > > the config language can also query that), but that prevents the GC from > > throwing out a lot of things. > > I'm using whatever Debian testing has: 0.6.2-1 & ghc 7.0.4. GHC in testing is at 7.4. But 0.6.2-1 should have been compiled with that. > > This is a valid request. Currently, the system makes no assumption of > > the ordering of entries in the file. Some code that checks for > > $sampleage relations and fast-forwards the log file to the right > > position might help (although it still needs to be read linearly, as > > there is no seek information and the records are of varying length). > > I'd expect just some sort of filter would give the right behavior - > 'filter (userInput) $ parse $ read file' if you follow me. with > $sampleage, this ought to throw out every entry until it hits <24:00 > ago and then the filter starts returning some entries. I looked at the code again and the problem is that it currently keeps track of the whole list for several reasons: * There can be multiple report being processed. * Some global data (i.e. total number of records) is calculated first and then shared between possibly multiple report passes. * Some reports also refer to the non-selected time (?% of total time selected?). So making arbtt-stats O(1) is a non-trivial refactoring. > > Ok, that should be fixable easy by allowing a list of values on the RHS > > of a == or =~. Is this what you would want to use? > > I *think* that should work. > > > Oh, and while I am at it I implemented "... == [ "x", "y", "z"]" and > > "... =~ [ m!regex1!, m!regex2!]" support. Do you want to test it from > > http://darcs.nomeata.de/arbtt/ or should I just release it? > > I can't compile it - src/Data.hs spits an error: > > src/Data.hs:31:34: > Could not deduce (NFData UTCTime) arising from a use of `deepseq' > from the context (NFData a) > bound by the instance declaration at src/Data.hs:30:10-44 > Possible fix: > add (NFData UTCTime) to the context of the instance declaration > or add an instance declaration for (NFData UTCTime) > In the first argument of `deepseq', namely `a `deepseq` b' > In the first argument of `deepseq', namely > `a `deepseq` b `deepseq` c' > In the expression: a `deepseq` b `deepseq` c `deepseq` () > cabal: Error: some packages failed to install: > arbtt-0.6.3 failed during the building phase. The exception was: > ExitFailure 1 You need time >= 1.4 (which should come with GHC 7.4); I fixed the cabal file accordingly. Greetings, Joachim -- Joachim Breitner e-Mail: mail at joachim-breitner.de Homepage: http://www.joachim-breitner.de Jabber-ID: nomeata at joachim-breitner.de -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From mail at joachim-breitner.de Mon Sep 17 09:12:05 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Mon, 17 Sep 2012 09:12:05 +0200 Subject: arbtt feedback In-Reply-To: References: <1347704167.4115.13.camel@kirk> <1347790801.4398.6.camel@kirk> <1347822043.4398.19.camel@kirk> Message-ID: <1347865925.4056.1.camel@kirk> Hi, Am Sonntag, den 16.09.2012, 18:12 -0400 schrieb Gwern Branwen: > On Sun, Sep 16, 2012 at 3:00 PM, Joachim Breitner > wrote: > > Have you tried dist-upgrade? (I am part of the Debian team that > > maintains ghc, so I?m interested in user reports). > > Nah. Recompiling everything I use is a waste of time unless I'm > actually developing something, so I put it off as long as possible. understandably. But does apt-get -u dist-upgrade at least offer you to upgrade ghc without removing any libraries besides those that have been dropped from testing? You can still say ?no? after checking that :-) BTW, I do not expect the haskell packages in testing to change until the release, so any time from now to then is a good time to upgrade. Greetings, Joachim -- Joachim Breitner e-Mail: mail at joachim-breitner.de Homepage: http://www.joachim-breitner.de Jabber-ID: nomeata at joachim-breitner.de -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From mail at joachim-breitner.de Thu Sep 27 00:44:11 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Thu, 27 Sep 2012 00:44:11 +0200 Subject: Regarding arbtt In-Reply-To: References: <1348672011.5337.22.camel@kirk> Message-ID: <1348699451.12383.10.camel@kirk> Hi, Am Mittwoch, den 26.09.2012, 17:33 +0200 schrieb Karl Yngve Lerv?g: > There is a mailing list (arbtt at lists.nomeata.de) ? do you mind if I > forward your mails there too, for archiving and for the benefit of other > users? > > No, I don't mind (and I added myself to the mailing list as well). Great, then I?ll reply there. > I would not mind an overhaul here. Are you willing and able to submit a > patch with a change to how you want it to look? > > > Willing, but right now I don't have very much time. I might look into > it later, though. Also, I have never done any projects in haskell > before, so if you could direct me to the relevant location where the > text output is generated, it would be helpful. In http://darcs.nomeata.de/arbtt/src/Stats.hs the function renderReportText is responsible for the Table layout. > Do you have a git/mercurial repository? http://darcs.nomeata.de/arbtt is a darcs repository. If you do not want to use darcs, you can use the git mirror at http://git.nomeata.de/?p=darcs-mirror-arbtt.git;a=summary but note that this might not have a consistent history, as it is basically recreated from darcs every time I push to it. But good enough to hack on a short-lived feature branch, I guess. Greetings, Joachim -- Joachim Breitner e-Mail: mail at joachim-breitner.de Homepage: http://www.joachim-breitner.de Jabber-ID: nomeata at joachim-breitner.de -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From mail at joachim-breitner.de Wed Sep 26 17:06:51 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Wed, 26 Sep 2012 17:06:51 +0200 Subject: Regarding arbtt In-Reply-To: References: Message-ID: <1348672011.5337.22.camel@kirk> Dear Karl, Am Mittwoch, den 26.09.2012, 16:52 +0200 schrieb Karl Yngve Lerv?g: > I just started using arbtt this week, and I really like it very well! thanks! > I did not find any project site where I could submit issues/comments > (similar to a standard github site, for instance), so I email you > directly. There is a mailing list (arbtt at lists.nomeata.de) ? do you mind if I forward your mails there too, for archiving and for the benefit of other users? > I do not have any direct issues, but I do have a simple request. I > find the output of arbtt-stats to be a little bit ugly, and I have a > "simple" request to update the output slightly. Consider the output > below: I would suggest that the tags are left-centered, not > right-center. Further, I would suggest to have a full line seperator > below the column titles (and not just underscores). Also, the ===-line > and the ____ (or my suggestion ----) lines should have the same > length. > > > Of course, since you have added the option --output-format=..., I can > just do this in a simple script myself, but I think that a simple > improvement of the text output would be very nice. I would not mind an overhaul here. Are you willing and able to submit a patch with a change to how you want it to look? Greetings, Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From karl.yngve at gmail.com Wed Sep 26 16:52:15 2012 From: karl.yngve at gmail.com (=?ISO-8859-1?Q?Karl_Yngve_Lerv=E5g?=) Date: Wed, 26 Sep 2012 16:52:15 +0200 Subject: Regarding arbtt Message-ID: Hi, I just started using arbtt this week, and I really like it very well! I did not find any project site where I could submit issues/comments (similar to a standard github site, for instance), so I email you directly. I do not have any direct issues, but I do have a simple request. I find the output of arbtt-stats to be a little bit ugly, and I have a "simple" request to update the output slightly. Consider the output below: I would suggest that the tags are left-centered, not right-center. Further, I would suggest to have a full line seperator below the column titles (and not just underscores). Also, the ===-line and the ____ (or my suggestion ----) lines should have the same length. Of course, since you have added the option --output-format=..., I can just do this in a simple script myself, but I think that a simple improvement of the text output would be very nice. Anyway, thanks for making a very useful and good program! Best regards, Karl Yngve Lerv?g Statistics for category "project" ================================= ____________________Tag_|______Time_|_Percentage_ project:DDA | 1h11m00s | 38.17 project:system | 7m00s | 3.76 project:general | 5m00s | 2.69 project:procrastination | 4m00s | 2.15 (unmatched time) | 1h39m00s | 53.23 -------------- next part -------------- An HTML attachment was scrubbed... URL: From karl.yngve at gmail.com Wed Sep 26 17:33:18 2012 From: karl.yngve at gmail.com (=?ISO-8859-1?Q?Karl_Yngve_Lerv=E5g?=) Date: Wed, 26 Sep 2012 17:33:18 +0200 Subject: Regarding arbtt In-Reply-To: <1348672011.5337.22.camel@kirk> References: <1348672011.5337.22.camel@kirk> Message-ID: Hi again, 2012/9/26 Joachim Breitner > Dear Karl, > > > Am Mittwoch, den 26.09.2012, 16:52 +0200 schrieb Karl Yngve Lerv?g: > > I just started using arbtt this week, and I really like it very well! > > thanks! > > > I did not find any project site where I could submit issues/comments > > (similar to a standard github site, for instance), so I email you > > directly. > > There is a mailing list (arbtt at lists.nomeata.de) ? do you mind if I > forward your mails there too, for archiving and for the benefit of other > users? > No, I don't mind (and I added myself to the mailing list as well). > > > I do not have any direct issues, but I do have a simple request. I > > find the output of arbtt-stats to be a little bit ugly, and I have a > > "simple" request to update the output slightly. Consider the output > > below: I would suggest that the tags are left-centered, not > > right-center. Further, I would suggest to have a full line seperator > > below the column titles (and not just underscores). Also, the ===-line > > and the ____ (or my suggestion ----) lines should have the same > > length. > > > > > > Of course, since you have added the option --output-format=..., I can > > just do this in a simple script myself, but I think that a simple > > improvement of the text output would be very nice. > > I would not mind an overhaul here. Are you willing and able to submit a > patch with a change to how you want it to look? > Willing, but right now I don't have very much time. I might look into it later, though. Also, I have never done any projects in haskell before, so if you could direct me to the relevant location where the text output is generated, it would be helpful. Do you have a git/mercurial repository? Best, Karl > > Greetings, > Joachim > > -- > Joachim "nomeata" Breitner > mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C > xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gwern0 at gmail.com Wed Sep 26 02:58:00 2012 From: gwern0 at gmail.com (Gwern Branwen) Date: Tue, 25 Sep 2012 20:58:00 -0400 Subject: arbtt feedback In-Reply-To: <1347704167.4115.13.camel@kirk> References: <1347704167.4115.13.camel@kirk> Message-ID: On Sat, Sep 15, 2012 at 6:16 AM, Joachim Breitner wrote: > Oh, and while I am at it I implemented "... == [ "x", "y", "z"]" and > "... =~ [ m!regex1!, m!regex2!]" support. Do you want to test it from > http://darcs.nomeata.de/arbtt/ or should I just release it? After a long afternoon, dist-upgrade finished. Always takes forever. Anyway: The syntax seems to work well, although I question the need for m!! or ""s when it's already inside a =~ or == list. Performance is still bad - can't look at previous day with Firefox open and without Arbtt being killed at 30+% RAM. -- gwern http://www.gwern.net From nomeata at debian.org Fri Sep 28 00:05:10 2012 From: nomeata at debian.org (Joachim Breitner) Date: Fri, 28 Sep 2012 00:05:10 +0200 Subject: arbtt feedback In-Reply-To: References: <1347704167.4115.13.camel@kirk> Message-ID: <1348783510.3379.4.camel@kirk> Hi, Am Dienstag, den 25.09.2012, 20:58 -0400 schrieb Gwern Branwen: > The syntax seems to work well, although I question the need for m!! or > ""s when it's already inside a =~ or == list. see it as a form of explicit typing; it reduces the risk that someone writes a string when he means a regex or the other way around. > Performance is still bad - can't look at previous day with Firefox > open and without Arbtt being killed at 30+% RAM. Finally I felt bold enough to tackle this problem and indeed I managed to refactor the code to process input data in one go, thanks to the power of the left fold, applicative and careful strictness. Here I now need only 10MBs. I did not yet make a release, but the change is in darcs, if someone wants to review it from there. Here is the patch: http://darcs.nomeata.de/cgi-bin/darcsweb.cgi?r=arbtt;a=commitdiff;h=20120927215912-23c07-276f00ebc5d076859c42b8ebb340d93a86767253.gz Especially figuring out how to do processIntervalReport in src/Stats.hs was an interesting exercise... Greetings, Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From gwern0 at gmail.com Fri Sep 28 00:47:49 2012 From: gwern0 at gmail.com (Gwern Branwen) Date: Thu, 27 Sep 2012 18:47:49 -0400 Subject: arbtt feedback In-Reply-To: <1348783510.3379.4.camel@kirk> References: <1347704167.4115.13.camel@kirk> <1348783510.3379.4.camel@kirk> Message-ID: On Thu, Sep 27, 2012 at 6:05 PM, Joachim Breitner wrote: > Finally I felt bold enough to tackle this problem and indeed I managed > to refactor the code to process input data in one go, thanks to the > power of the left fold, applicative and careful strictness. Here I now > need only 10MBs. > > I did not yet make a release, but the change is in darcs, if someone > wants to review it from there. Here is the patch: > http://darcs.nomeata.de/cgi-bin/darcsweb.cgi?r=arbtt;a=commitdiff;h=20120927215912-23c07-276f00ebc5d076859c42b8ebb340d93a86767253.gz Vastly improved, thanks. -- gwern http://www.gwern.net From gwern0 at gmail.com Sun Sep 30 21:17:08 2012 From: gwern0 at gmail.com (Gwern Branwen) Date: Sun, 30 Sep 2012 15:17:08 -0400 Subject: Competitors Message-ID: http://github.com/gurgeh/selfspy http://news.ycombinator.com/item?id=4590987 -- gwern http://www.gwern.net From mail at joachim-breitner.de Sun Sep 30 23:27:39 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Sun, 30 Sep 2012 23:27:39 +0200 Subject: Competitors In-Reply-To: References: Message-ID: <1349040459.12828.0.camel@kirk> Hi, Am Sonntag, den 30.09.2012, 15:17 -0400 schrieb Gwern Branwen: > http://github.com/gurgeh/selfspy > http://news.ycombinator.com/item?id=4590987 interesting, thanks for the link. I was surprised that this idea does not exist in more incarnations. Greetings, Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From mail at joachim-breitner.de Wed Oct 3 01:57:16 2012 From: mail at joachim-breitner.de (Joachim Breitner) Date: Wed, 03 Oct 2012 01:57:16 +0200 Subject: More speedup in darcs; "format $date" found to be expensive Message-ID: <1349222236.26891.4.camel@kirk> Hi, I did some more speed analysis and found that the use of "format $date" will considerably slow down your analysis. The next release of arbtt will therefore also provide date literals, so that you can write $date >= 2011-01-01 && $date <= 2011-02-01 without conversions to strings or anything of the like. I can process my own data in just below 9 seconds now; Now the largest single chunks of time are parsing the binary data and using the regex library. Greetings, Joachim -- Joachim "nomeata" Breitner mail at joachim-breitner.de | nomeata at debian.org | GPG: 0x4743206C xmpp: nomeata at joachim-breitner.de | http://www.joachim-breitner.de/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From ml at isaac.cedarswampstudios.org Mon Dec 31 00:05:26 2012 From: ml at isaac.cedarswampstudios.org (Isaac Dupree) Date: Sun, 30 Dec 2012 18:05:26 -0500 Subject: some fixes! Message-ID: <50E0C8B6.4050707@isaac.cedarswampstudios.org> Funny story: I found arbtt because I was writing exactly the same idea in Haskell, searched for Haskell bindings to the XScreenSaver extension, and the arbtt repository was the only one that had those bindings. (Off-topic: Those bindings should probably be in the X11 package.) I attached the darcs patches I needed to get arbtt working well enough for me on GHC 7.6.1 and XMonad (on Arch Linux). Did I do 'darcs send' right? Do the patches need improvement? -Isaac -------------- next part -------------- 3 patches for repository http://darcs.nomeata.de/arbtt: Sun Dec 30 16:22:54 EST 2012 Isaac Dupree * Fix build with base 4.6 (GHC 7.6) (Someone who knows this code / these exceptions better could probably use Control.Exception.catch to only catch the specific IO exceptions we're interested in. This patch, however, does not change which exceptions are caught.) Sun Dec 30 17:16:23 EST 2012 Isaac Dupree * restore smarter & non-crashy followTreeUntil Following along from http://lists.nomeata.de/archive/arbtt/2012/000144.html I tried hacking on followTreeUntil in various ways and found that on my system, calling queryTree with 0 as the window argument seems to cause a segfault after the 12th or 13th call. (A way to test for a segfault: replace 'w' in the queryTree call with '0'; rebuild; call arbtt-capture with -r 0 or -r 1 depending on patience.) (XQueryTree() returns 0 as the parent window when it's called on the root window [and maybe at other times? Its man page didn't say anything about when it returns 0].) The root-window-avoiding behavior from before is useful for XMonad. So I restore that, while retaining the /= 0 checks. For paranoia's sake I make extra sure that followTreeUntil can never call queryTree with 0 as the window param. Sun Dec 30 17:27:39 EST 2012 Isaac Dupree * Semi-fix arbtt for xmonad (a non-_NET_CLIENT_LIST-setting WM) This now captures (only) the currently focused window; I'm not personally interested in other windows so I'm not trying harder to fix that part. XMonad is a non-reparenting wm, so all interesting windows have a root window as their parent, so this method works fine. As JOKer notes[1], the i3 window manager would need a bit more work: it does not provide _NET_CLIENT_LIST but it does reparent managed windows to inside its own container windows. We'd need to detect those container windows in the arbtt code. I don't currently have an i3 wm set up to look for a good method; JOKer posts a method that worked for them[1]. [1] http://lists.nomeata.de/archive/arbtt/2012/000145.html (The "filter (/= 0)" is just paranoia in case the _NET_CLIENT_LIST contains 0 or the focused window is 0 somehow due to odd WMs or focuses. This check wasn't necessary for my quick tests in the particular WM setup I have.) New patches: [Fix build with base 4.6 (GHC 7.6) Isaac Dupree **20121230212254 Ignore-this: a91f4ab1f7b285e54c7c4aea94762c5b (Someone who knows this code / these exceptions better could probably use Control.Exception.catch to only catch the specific IO exceptions we're interested in. This patch, however, does not change which exceptions are caught.) ] hunk ./arbtt.cabal 33 main-is: capture-main.hs hs-source-dirs: src build-depends: - base == 4.5.*, filepath, directory, transformers, time >= 1.4, utf8-string, + base == 4.5.* || == 4.6.*, + filepath, directory, transformers, time >= 1.4, utf8-string, bytestring, binary, deepseq, strict, terminal-progress-bar, bytestring-progress other-modules: hunk ./src/Capture/X11.hs 8 import Graphics.X11.Xlib.Extras import Control.Monad import Control.Exception (bracket) +import System.IO.Error (catchIOError) import Control.Applicative import Data.Maybe import Data.Time.Clock hunk ./src/Capture/X11.hs 81 myFetchName d w = do let getProp = (internAtom d "_NET_WM_NAME" False >>= getTextProperty d w) - `catch` + `catchIOError` (\_ -> getTextProperty d w wM_NAME) extract prop = do l <- wcTextPropertyToTextList d prop hunk ./src/Capture/X11.hs 87 return $ if null l then "" else head l - bracket getProp (xFree . tp_value) extract `catch` \_ -> return "" + bracket getProp (xFree . tp_value) extract + `catchIOError` \_ -> return "" hunk ./src/capture-main.hs 73 hPutStrLn stderr ("arbtt [Error]: Could not aquire lock for " ++ filename ++"!") exitFailure #else - flip catch (\e -> hPutStrLn stderr ("arbtt [Error]: Could not aquire lock for " ++ filename ++"!") >> exitFailure) $ do + flip catchIOError (\e -> hPutStrLn stderr ("arbtt [Error]: Could not aquire lock for " ++ filename ++"!") >> exitFailure) $ do fd <- openFd (filename ++ ".lck") WriteOnly (Just 0o644) defaultFileFlags setLock fd (WriteLock, AbsoluteSeek, 0, 0) #endif [restore smarter & non-crashy followTreeUntil Isaac Dupree **20121230221623 Ignore-this: 6410333233854d7b5048d8b08ab1b1ca Following along from http://lists.nomeata.de/archive/arbtt/2012/000144.html I tried hacking on followTreeUntil in various ways and found that on my system, calling queryTree with 0 as the window argument seems to cause a segfault after the 12th or 13th call. (A way to test for a segfault: replace 'w' in the queryTree call with '0'; rebuild; call arbtt-capture with -r 0 or -r 1 depending on patience.) (XQueryTree() returns 0 as the parent window when it's called on the root window [and maybe at other times? Its man page didn't say anything about when it returns 0].) The root-window-avoiding behavior from before is useful for XMonad. So I restore that, while retaining the /= 0 checks. For paranoia's sake I make extra sure that followTreeUntil can never call queryTree with 0 as the window param. ] hunk ./src/Capture/X11.hs 65 getProgramName :: Display -> Window -> IO String getProgramName dpy = fmap resName . getClassHint dpy --- | Follows the tree of windows up until the condition is met or the root --- window is reached. +-- | Follows the tree of windows up until the condition is met or the window is +-- a direct child of the root. followTreeUntil :: Display -> (Window -> Bool) -> Window -> IO Window followTreeUntil dpy cond = go hunk ./src/Capture/X11.hs 69 - where go w | cond w = return w - | otherwise = do (r,p,_) <- queryTree dpy w - if p == 0 then return w - else go p + where go w | 0 == w || cond w = return w + | otherwise = do + (r,p,_) <- queryTree dpy w + if p == 0 || p == r then return w + else go p -- | better than fetchName from X11, as it supports _NET_WM_NAME and unicode -- [Semi-fix arbtt for xmonad (a non-_NET_CLIENT_LIST-setting WM) Isaac Dupree **20121230222739 Ignore-this: b98d8743723a5d5b1a88adaae6225f6c This now captures (only) the currently focused window; I'm not personally interested in other windows so I'm not trying harder to fix that part. XMonad is a non-reparenting wm, so all interesting windows have a root window as their parent, so this method works fine. As JOKer notes[1], the i3 window manager would need a bit more work: it does not provide _NET_CLIENT_LIST but it does reparent managed windows to inside its own container windows. We'd need to detect those container windows in the arbtt code. I don't currently have an i3 wm set up to look for a good method; JOKer posts a method that worked for them[1]. [1] http://lists.nomeata.de/archive/arbtt/2012/000145.html (The "filter (/= 0)" is just paranoia in case the _NET_CLIENT_LIST contains 0 or the focused window is 0 somehow due to odd WMs or focuses. This check wasn't necessary for my quick tests in the particular WM setup I have.) ] hunk ./src/Capture/X11.hs 14 import Data.Time.Clock import System.IO import qualified Data.MyText as T +import qualified Data.List as List import System.Locale.SetLocale import Graphics.X11.XScreenSaver (getXIdleTime, compiledWithXScreenSaver) hunk ./src/Capture/X11.hs 31 a <- internAtom dpy "_NET_CLIENT_LIST" False p <- getWindowProperty32 dpy a rwin when (isNothing p) $ do - hPutStrLn stderr "arbtt: ERROR: No _NET_CLIENT_LIST set for the root window" + hPutStrLn stderr "arbtt: WARNING: No _NET_CLIENT_LIST set for the root window," + hPutStrLn stderr " so arbtt can only capture focused windows" closeDisplay dpy captureData :: IO CaptureData hunk ./src/Capture/X11.hs 51 (fsubwin,_) <- getInputFocus dpy fwin <- followTreeUntil dpy (`elem` wins) fsubwin - winData <- forM wins $ \w -> (,,) + let loggedWins = filter (/= 0) + (List.union wins [fwin]) + + winData <- forM loggedWins $ \w -> (,,) (w == fwin) <$> (T.pack <$> getWindowTitle dpy w) <*> (T.pack <$> getProgramName dpy w) Context: [Merge bugfix release Joachim Breitner **20121115110410 Ignore-this: aca7d7e2f1376105cd8f865049068960 ] [TAG 0.6.4.1 Joachim Breitner **20121115110310 Ignore-this: 9a2581849bffdee4ee468adffaaebf3 ] [Forgot to add LeftFold to .cabal file Joachim Breitner **20121115110213 Ignore-this: c469890ff016ad194e345d23ec5069f6 ] [Try to parse UTF8 Bytestrings more efficiently Joachim Breitner **20121003095614 Ignore-this: 9d82d7b96af5bf3b1e2f6f33e4b5b59c ] [Future code to speed up Data.MyText.get Joachim Breitner **20121003091856 Ignore-this: ef97e016680c036d8e750bf1205a85b6 ] [SCC diffTimeFromRational Joachim Breitner **20121003091851 Ignore-this: a2f995b5c4b5d7e79b1789b2f3723b95 ] [Avoid mixup of title and progress bar Joachim Breitner **20121003084150 Ignore-this: 49df6319d0c73629248469d0f1554c4f ] [Share currentWindow, small speedup Joachim Breitner **20121003083744 Ignore-this: 1512364075d3cccca5ec2af405a36481 ] [docbook fix Joachim Breitner **20121002235616 Ignore-this: 3f00021820f6e86b9c2dfd48360c5eee ] [Use TimeZone at parse time, considerable speedup Joachim Breitner **20121002234716 Ignore-this: 733f51e288783dee0e073be4f84009c ] [Pass TimeZone already at parse time Joachim Breitner **20121002234641 Ignore-this: 7c3f6c8a7db085dd31afa2bb97de2e08 ] [Add failing operators to Text.Parsec.ExprFail Joachim Breitner **20121002234628 Ignore-this: 7fd5aac79328f3da47cf0cf53313172d ] [Import Text.Parsec.Expr from parsec-3.1.3 Joachim Breitner **20121002233445 Ignore-this: 48dcfdc43ead4cfcfa68f9d5b9dca8fe ] [More strictness in the advanced MapFold operations Joachim Breitner **20121002225115 Ignore-this: 7577ac985102b1d8fab76714eef728b9 ] [Support for date literals Joachim Breitner **20121002203246 Ignore-this: ef831b034449bf5b554a0d974daa4c12 ] [Warn about format speed Joachim Breitner **20121002195422 Ignore-this: a0f8092a2a6638566bc2ea32c90571db ] [Ensure logfile is not world-readable Joachim Breitner **20120929210618 Ignore-this: 4ada859e37ed264fa0651f902d5d22c ] [Show a progress bar in arbtt-stats Joachim Breitner **20120928203659 Ignore-this: 257a2895d8ef8ecedd2521a5f104968c ] [TAG 0.6.4 Joachim Breitner **20120928165721 Ignore-this: 49acb948bbc371d27c99887b7698a498 ] Patch bundle hash: 8f94ecfb9f037c5d24460075bfe8b57758681740