You are not logged in.
Pages: 1
Topic closed
Hi everyone. I'm trying to get a command line screenshot utility set up, but I might be out of options. imagemagick's import doesn't support transparency, and scrot is throwing this weird error at me.
I'm using this script:
#!/bin/bash
DIR="${HOME}/Desktop"
DATE="$(date +%Y-%B-%d_%I.%M.%S%P)"
NAME="${DIR}/screenshot_${DATE}.png"
# Capture a window or rectangle
if [ "$1" = "win" ]; then scrot -sb "${NAME}" 2> ${DIR}/error; fi
if [ "$1" = "dwin" ]; then scrot -d 5 -sb "${NAME}" 2> ${DIR}/error; fi
# Capture entire screen
if [ "$1" = "scr" ]; then scrot "${NAME}"; fi
if [ "$1" = "dscr" ]; then scrot -d 5 "${NAME}"; fi
Running it from a terminal, dmenu, gnome-do, or another bash script works without problem. When I try to run it with "win" or "dwin" (scrot --select) from a compiz keyboard shortcut however, the operation fails with:
giblib error: couldn't grab keyboard:Resource temporarily unavailable
Any advice on getting this to work, or finding another lightweight screenshot solution?
Thanks for any help!
Offline
it`s really old but I came across the same error - using i3wm - today, so it might still be worth the answer.
scrot --select --quality 40 --exec 'mv -v $f ~/tmp && feh ~/tmp/$f' '%Y-%m-%d_%H%M%e_$wx$h_screenshot.png'
worked on the commandline but not when put on a hot key
the xmonad guys found a solution:
http://code.google.com/p/xmonad/issues/detail?id=476
bindsym Control+Print exec "sleep 0.2 ; scrot --select --quality 40 --exec 'mv -v $f ~/tmp && feh ~/tmp/$f' '%Y-%m-%d_%H%M%e_$wx$h_screenshot.png'"
worked though. (notice the "sleep 0.2 ; " upfront)
Offline
slaxor, thanks for providing a possible solution. Since this thread is really old, I am going to close it now to avoid further necros.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
Pages: 1
Topic closed