Re: [dev] [dwm] scrot -s fails

2011-08-19 Thread anonymous
On Fri, Aug 19, 2011 at 10:34:28PM +, Bjartur Thorlacius wrote:
> Þann fös 19.ágú 2011 21:51, skrifaði anonymous:
> >I have tried to do the same thing.  Bound scrot to MODKEY+g, pressed
> >it and switched to first TTY.  It says "giblib error: couldn't grab
> >keyboard: Resource temporarily unavailable".  Don't know how to fix it,
> >but i think it is a problem in dwm.
> >
> I wonder whether if dwm and scrot are trying to grab the same keys
> on the root window. What keys does scrot bind?
> 
If it was the problem, scrot would not work from dmenu/terminal
emulator. It don't work only when you try to use it from dwm binding.




Re: [dev] [dwm] scrot -s fails

2011-08-19 Thread Connor Lane Smith
Hey,

On 19 August 2011 22:51, anonymous  wrote:
> I have tried to do the same thing.  Bound scrot to MODKEY+g, pressed
> it and switched to first TTY.  It says "giblib error: couldn't grab
> keyboard: Resource temporarily unavailable".  Don't know how to fix it,
> but i think it is a problem in dwm.

I think this is a bug in scrot. Every X utility worth its salt runs a
loop attempting to bind the keyboard a number of times (see dmenu, but
there are many others), since the resource *can* be temporarily
unavailable. Scrot does not.

This may be a bug in dwm, if you try looping and it fails, but I doubt it.

Thanks,
cls



Re: [dev] [dwm] scrot -s fails

2011-08-19 Thread Bjartur Thorlacius

Þann fös 19.ágú 2011 21:51, skrifaði anonymous:

I have tried to do the same thing.  Bound scrot to MODKEY+g, pressed
it and switched to first TTY.  It says "giblib error: couldn't grab
keyboard: Resource temporarily unavailable".  Don't know how to fix it,
but i think it is a problem in dwm.

I wonder whether if dwm and scrot are trying to grab the same keys on 
the root window. What keys does scrot bind?




Re: [dev] [dwm] scrot -s fails

2011-08-19 Thread Steven Blatchford
On 20:22 Fri 19 Aug, Bastien Dejean wrote:
>Hi,
>
>The following command don't work (i.e. I can't select the region of the
>screen I'm willing to capture) when it's spawn from dwm:
>
>static const char *partialshotcmd[]  = { "scrot", "-s", NULL };
>
>Any idea why?

...which is part of the imagemagick package.



Re: [dev] [dwm] scrot -s fails

2011-08-19 Thread Steven Blatchford
On 20:22 Fri 19 Aug, Bastien Dejean wrote:
>Hi,
>
>The following command don't work (i.e. I can't select the region of the
>screen I'm willing to capture) when it's spawn from dwm:
>
>static const char *partialshotcmd[]  = { "scrot", "-s", NULL };
>
>Any idea why?

An IRC discussion on Jul 03, 2011 suggested to use 'import'.

-steve



Re: [dev] [dwm] scrot -s fails

2011-08-19 Thread anonymous
On Fri, Aug 19, 2011 at 07:30:08PM +, Bjartur Thorlacius wrote:
> Þann fös 19.ágú 2011 18:22, skrifaði Bastien Dejean:
> >static const char *partialshotcmd[]  = { "scrot", "-s", NULL };
> >
> I'd guess that the argument is never passed, as the string is
> terminated by the NUL after scrot.
> 
> If I read your code correctly, the array contains:
> s, c, r, o, t, NUL, -, s, NUL, NULL.
> 
> Where the trailing NULL is probably equal to NUL as well. That's
> three NUL instead of the intended one - as C's string notation
> appends NULs after the character array.
> 

The array contains tree pointers: pointer to NUL-terminated "scrot"
string, pointer to NUL-terminated "-s" string and NULL pointer.




Re: [dev] [dwm] scrot -s fails

2011-08-19 Thread anonymous
On Fri, Aug 19, 2011 at 08:22:12PM +0200, Bastien Dejean wrote:
> Hi,
> 
> The following command don't work (i.e. I can't select the region of the
> screen I'm willing to capture) when it's spawn from dwm:
> 
> static const char *partialshotcmd[]  = { "scrot", "-s", NULL };
> 
> Any idea why?
> 
> -- 
> Bastien
> 

I have tried to do the same thing.  Bound scrot to MODKEY+g, pressed
it and switched to first TTY.  It says "giblib error: couldn't grab
keyboard: Resource temporarily unavailable".  Don't know how to fix it,
but i think it is a problem in dwm.




Re: [dev] [dwm] scrot -s fails

2011-08-19 Thread Bjartur Thorlacius

Þann fös 19.ágú 2011 19:30, skrifaði Bjartur Thorlacius:
Pure batshit to be ignored, it seems.



Re: [dev] [dwm] scrot -s fails

2011-08-19 Thread Bjartur Thorlacius

Þann fös 19.ágú 2011 18:22, skrifaði Bastien Dejean:

static const char *partialshotcmd[]  = { "scrot", "-s", NULL };

I'd guess that the argument is never passed, as the string is terminated 
by the NUL after scrot.


If I read your code correctly, the array contains:
s, c, r, o, t, NUL, -, s, NUL, NULL.

Where the trailing NULL is probably equal to NUL as well. That's three 
NUL instead of the intended one - as C's string notation appends NULs 
after the character array.




[dev] [dwm] scrot -s fails

2011-08-19 Thread Bastien Dejean
Hi,

The following command don't work (i.e. I can't select the region of the
screen I'm willing to capture) when it's spawn from dwm:

static const char *partialshotcmd[]  = { "scrot", "-s", NULL };

Any idea why?

-- 
Bastien