You are not logged in.

#1 2009-12-10 05:53:06

evilgnome
Member
Registered: 2009-02-20
Posts: 62

scrot/giblib: couldn't grab keyboard:Resource temporarily unavailable

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

#2 2014-03-13 19:15:30

slaxor
Member
Registered: 2014-03-02
Posts: 2

Re: scrot/giblib: couldn't grab keyboard:Resource temporarily unavailable

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

#3 2014-03-26 18:45:57

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: scrot/giblib: couldn't grab keyboard:Resource temporarily unavailable

slaxor, thanks for providing a possible solution. Since this thread is really old, I am going to close it now to avoid further necros.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB