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.
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"
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:
# Print screen None Print :Exec xsnap -file "$HOME/tmp/ss/$(date +'%Y-%m-%d--%H:%M:%S.png')" #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'