Little Brother: spying on yourself for fun and profit

26 May 2010

Technology 

Originally posted at https://tech.labs.oliverwyman.com/blog/2010/05/26/little-brother-spying-on-yourself-for-fun-and-profit/

One of the internal tools that some of us use is a little script called getcap. Using the venerable xwd and ImageMagick, along with a bit of shell scripting it gets run by cron 8 times an hour and dumps a screen capture into a hidden folder in your home directory. As you can imagine, this is the sort of thing that if someone else was doing it would be a nasty invasion of privacy, but if you’re doing it for yourself, it becomes invaluable for accurately filling in timesheets, especially when you’re busy juggling 3-4 different projects.

I’d run into a few problems with it however, primary being that xwd doesn’t play nice with compositing, and so my Docky instance at the top of the screen looks like a big black patch across the screenshots, which occasionally blocks useful information.

I’ve therefore written a replacement, called LittleBrother, using primarily Python and gtk. Initially I was just following the instructions on the PyGtk FAQ on how to capture your screen, but then I figured I could do a bit more. So, we now have a little status bar icon that lets you open up the screenshots folder (using xdg-open so the right file manager gets used), and instead of having to hardcode in the times when you’re in the office, it instead uses the DBus interface of the Gnome screensaver (patches for other screensavers welcomed) to detect when the screensaver is active, and only take captures when it’s inactive. I found the D-feet DBus introspection tool particularly useful for playing around with this step.

Code is available on Github, and there’s even a Debian package available as well.

Previously: Debian build-depends metapackages Next: “Nearby art”: using the V&A API and geolocation