In my Fluxbox keys, I have three keys to take different kind of screenshots using scrot, whole screen, window, and window with window manager decoration aka window border. If I only need a portion of screen, I would grab the whole screen, then use GIMP to crop it; or I will use GIMP to grab screenshot.

Recently, I started to looking for a note taking program and I chose KeepNote. It has a hotkey Ctrl+Insert to insert a screenshot from an external command, I think it’s very interesting and useful function to me. The default command is ImageMagick’s import. For some unknown reason, it always gave me an all black screenshot if I select normal windows area, but Fluxbox’s toolbar can be grabbed correctly and I could have correct screenshot if I run import from a shell.

Note

I’m no longer using KeepNote since 2010-11-15, now Vim Notes, instead. (2015-08-19T22:48:20Z)

Of course, I could always make a screenshot, then import it into KeepNote, but that seems to take too much efforts.

So, I found a program called xsnap, I am using version 1.5.6. It supports window (mouse middle button click) and region grab (drag a region). It doesn’t accept a filename by default, a simple shell script for KeepNote to do the job:


xsnap -png -file "$1"

Note

my use cases. (2015-08-19T22:42:24Z)

I also specify the format, though PNG is the default format.

I think it’s also the time to let scrot get retired in my Fluxbox keys:


None Print :Exec xsnap -file "$HOME/tmp/ss/$(date +'%Y-%m-%d--%H:%M:%S.png')"

Note

I’ve switched to dwm since 2011-07-06. (2015-08-19T22:43:56Z)

The old ones using scrot:


None Print Print :Exec scrot '%Y-%m-%d--%H:%M:%S_$wx$h.png' -e 'mv $f ~/tmp/ss'
None Print S :Exec scrot -s -d 1 '%Y-%m-%d--%H:%M:%S_$wx$h.png' -e 'mv $f ~/tmp/ss'
None Print B :Exec scrot -s -b -d 1 '%Y-%m-%d--%H:%M:%S_$wx$h.png' -e 'mv $f ~/tmp/ss'