You are not logged in.

#1 2013-03-19 09:58:24

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

[SOLVED] "scrot -s" Not triggering via .xbindkeysrc

I'm trying to get "scrot -s" to trigger which I click "Cntrl+Alt+4" however it doesn't work when the "-s"  - meaning select area of the screen with the mouse - is added.


In .xbindkeysrc I have:

# Screenshot of a section of a screen (Cntrl+Alt+4)
"scrot -sh"
      m:0xc + c:13
      Control+Alt+4

Any ideas?

Last edited by anthillsocial (2013-03-19 13:35:46)

Offline

#2 2013-03-19 10:41:45

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] "scrot -s" Not triggering via .xbindkeysrc

-h is the help option, so you just get the help returned.
Try opening a terminal and running it in that. Once that's working, you could try the working command without one.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#3 2013-03-19 11:05:01

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

Re: [SOLVED] "scrot -s" Not triggering via .xbindkeysrc

Thanks for that - though perhaps should have elaborated more.

"scrot -s" works perfectly from the terminal, its only when its triggered via a key bind that it fails.

Offline

#4 2013-03-19 11:21:52

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] "scrot -s" Not triggering via .xbindkeysrc

anthillsocial wrote:

Thanks for that - though perhaps should have elaborated more.

"scrot -s" works perfectly from the terminal, its only when its triggered via a key bind that it fails.

Your code snippet above has the -h option, is that a typo?
I'm not sure how scrot works, but you may need to launch a terminal that runs the command:

# Screenshot of a section of a screen (Cntrl+Alt+4)
"urxvtc -e bash -i -c 'scrot -sh'"
      m:0xc + c:13
      Control+Alt+4

Completely untested.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#5 2013-03-19 11:24:21

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [SOLVED] "scrot -s" Not triggering via .xbindkeysrc

Scrot does not need a terminal - but the "-sh" option will not take a screen shot, it will simply display the help information.  I suspect scrots help info is dumped to tty1, or .Xsession-errors, or to wherever your output from X is dumped.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2013-03-19 12:24:32

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

Re: [SOLVED] "scrot -s" Not triggering via .xbindkeysrc

RE: Your code snippet above has the -h option, is that a typo?
Ahh now I see what you mean - yes the -h option was a typo it actually reads:

# Screenshot of a section of a screen (Cntrl+Alt+4)
"urxvtc -e bash -i -c 'scrot -s'"
      m:0xc + c:13
      Control+Alt+4

Here's a bit more info elaborating what I mentioned above:

- Doesn't trigger: scrot -s
- Does trigger: scrot
- Does trigger: scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/Desktop'

So there seems to be something going on with the "-s" option

[EDIT] Oops. Have read the post properly. Will try suggestion then properly respond....

Last edited by anthillsocial (2013-03-19 12:26:35)

Offline

#7 2013-03-19 12:49:26

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

Re: [SOLVED] "scrot -s" Not triggering via .xbindkeysrc

Trilby wrote:

Scrot does not need a terminal - but the "-sh" option will not take a screen shot, it will simply display the help information.  I suspect scrots help info is dumped to tty1, or .Xsession-errors, or to wherever your output from X is dumped.

Just tested with urxvtc and that doesn't work either. It seems that scrot isn't being allowed to pause until mouse input is received.

Last edited by anthillsocial (2013-03-19 12:49:44)

Offline

#8 2013-03-19 12:52:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [SOLVED] "scrot -s" Not triggering via .xbindkeysrc

Send the output somewhere useful.

"scrot -s > ~/scrot_error 2>&1"


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#9 2013-03-19 13:18:53

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

Re: [SOLVED] "scrot -s" Not triggering via .xbindkeysrc

Trilby wrote:

Send the output somewhere useful.

"scrot -s > ~/scrot_error 2>&1"

It outputs:

giblib error: couldn't grab keyboard:Resource temporarily unavailable

Offline

#10 2013-03-19 13:29:20

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] "scrot -s" Not triggering via .xbindkeysrc

Try putting a sleep of a second or so before the call to scrot:

sleep 1
scrot -s

"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#11 2013-03-19 13:35:29

anthillsocial
Member
Registered: 2013-02-18
Posts: 129

Re: [SOLVED] "scrot -s" Not triggering via .xbindkeysrc

skanky - fantastic - that sorted it!
Thanks everyone.

Offline

Board footer

Powered by FluxBB