I'm trying to make it so I can do a screen shot with with the PrintScrn button in Awesome WM. I found an ImageMagick script with keybinding in the Wiki, but I'm not able to make it work. The script works if I call it in the command line. What I can't wrap my mind around is what exactly the keybinding is supposed to be doing with the script. Pulled from the Wiki:


 timestamp="$(date +%Y%m%d%H%M%S)"
 mkdir -p $targetbase
 [ -d $targetbase ] || exit 1
 import -window root $targetbase/$timestamp.png


 -- bind PrintScrn to capture a screen

I assume the "capscr" in the Lua code is calling the script? (The script is saved by the same name in my /home folder; specifically ~/.bin like it says in the Wiki). If not, do I need to do something else to the script and/or Lua code and/or ??? to make the two see each other? I've also tried putting the path of the script in the code to see if that worked, and nothing.


First of all you need make it executable. Then move it to /bin directory (you need root-rights):

$chmod +x capscr
$sudo mv ./capsrc /bin

I also recomend to you to edit capscr file, for example mine:

timestamp="$(date +%d.%m.%Y"_shot_"%H:%M:%S)"
mkdir -p $targetbase
[ -d $targetbase ] || exit 1
import -window root -quality 98 $targetbase/$timestamp.png

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.