Screenshots with Awesome WM and xsnap

One thing I really, really liked about Compiz was the ability to hold down CTRL, drag the mouse over part of the screen, and take a screenshot. Sadly I discovered this about a week before it broke in 11.04 – every screenshot had a blue tint.

After the move to Awesome WM, it seemed like scrot was the way to go, so I had a couple of binds to take a full screen shot with PrintScreen and a shot of the current window with the modkey and PrintScreen. It worked okay.

Then I found xsnap – a small utility that very nearly does the same as Compiz, when combined with a suitable key bind.

    awful.key({        }, "Print", 
          function () awful.util.spawn_with_shell("DATE=`date +%d%m%Y_%H%M%S`; xsnap -nogui -file $HOME/Temp/xsnap$DATE") end),

So now I hit PrintSreen, and drag the mouse over the area I want, and it’s saved with a simple datestamp in PNG format by default. And there are other command line options to play with, though it works fine for me as it is.

I can’t understand why this one doesn’t seem to be more well known, as for me, it deserves to be.

  1. How did you use scrot to make a screenshot of the current window only, rather than the whole screen?

    • I didn’t – I use xsnap.

      But if you ‘man scrot’, you find that:

      “-s, –select
      Interactively select a window or rectangle with the mouse. ”

      So that should do it for you.

      • I need the function for games and a shortcut for ‘make a screen of the currently active window (‘client’) would be swell 🙂

        A debian user told me that they have scrot -u but I wasn’t able to find that parameter in arch’s scrot.

        I’ll try to get xsnap to run on Arch. Thanks for the hint 🙂

  2. Nice comment, also worth noting the “import” program, part of imagemagick package, as noted in the archlinux wiki page “taking a screenshot”

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>