the default scrot save names are very long so this script changes the screenshot names to xxxx.png
first create the "images" folder in the root folder
place this script in /usr/bin/scrot-x, don't forget to chmod +x it
scrot-x
Code: Select all
#! /bin/bash
number=`sed -n "17 p" "$0"`
keep=$number
delay=0$1
if [ $delay -lt 1 ];
then
delay=0
fi
len=${#number}
while [ $len -lt 4 ];
do
number=0$number
len=$(($len+1))
done
scrot $number'.png' -d $delay -e 'mv $f ~/images/ & viewnior ~/images/$f' | sed -i "17s/$keep/$(($keep + 1))/" /usr/bin/scrot-x
exit
1
type this in a terminal
Code: Select all
xev | gawk '/keycode/{if($0!=l)printf "0x%x\n",$4;l=$0;}'
mine was 0x6f
so now i can add the key bindings to my rc.xml
Print screen for instant screenshot or alt+print screen for screenshot in 5 seconds (you can change to how many seconds you want)
in my case, it was
Code: Select all
<keybind key="0x6f">
<action name="Execute">
<execute>scrot-x</execute>
</action>
</keybind>
<keybind key="A-0x6f">
<action name="Execute">
<execute>scrot-x 5</execute>
</action>
</keybind>
Code: Select all
openbox -- reconfigure
questions / feedback highly appreciated