3 # Trigger xfce4-screenshooter on PrtSc/SysRq key
4 # Doesn't consume the key!!
5 # Arguments, if given, is a command to use for processing the screenshot,
6 # instead of getting a dialog about it. The capture is added as an
7 # additional final argument, as a file in /tmp.
9 # Example for simply saving it in the ~/Pictures directory.
10 # kbdo cp -t $HOME/Pictures
12 # Example for custom copying by inline scripting (same effect):
13 # kbdo 'bash -c "X(){ cp $1 $HOME/Pictures; }; X $1"' CP
15 # Note above, that bash needs CP as the $0 for the -c scripting
17 # Example for post-processing with convert into fix resolution
18 # kbdo 'bash -c "X(){ convert $1 -resize 800x600 ${1#.*}-x.png; }; X $1"' CVT
20 # Example for running custom script
21 # kbdo $HOME/bin/mycp arg1 arg2
23 # Note above, that the temporary snapshot file is added as an additional
24 # last argument ("arg3" as it were); something like /tmp/Screenshot-date.png
27 if [ -z "$ARGS" ] ; then
28 PRG=( /usr/bin/xfce4-screenshooter -w )
30 PRG=( /usr/bin/xfce4-screenshooter -w -o "$ARGS" )
35 stdbuf -o0 xxd -c 24 -p < /dev/input/event0 | \
36 stdbuf -o0 sed 's/.\{32\}//;s/\(.\{12\}\).*/\1/' | \
38 if [ "$EV" != "000000000000" ] ; then
43 if [ -z "${EVL%%*010063000100}" ] ; then
44 # Act on the [PrtSc/SysRq] key