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

2011-08-20 Thread Pascal Wittmann
On 08/20/2011 10:50 AM, Bastien Dejean wrote:
 Steven Blatchford a écrit :
 
 An IRC discussion on Jul 03, 2011 suggested to use 'import'.
 
 What is the equivalent in import to the -s argument in scrot?

Just call 'import filename' and drag your mouse over the area. Only
clicking will make a shot of the underlying window.



signature.asc
Description: OpenPGP digital signature


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

2011-08-20 Thread Anselm R Garbe
The reason for this behavior is that spawn() is executed before the key
release handling happens in dwm, thus scrot fails to grab the keyboard.

I consider adding a flag to execute a key binding on release.

Thanks for reporting this.

Cheers
Anselm
 Am 19.08.2011 20:22 schrieb Bastien Dejean esch...@gmail.com:
 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



[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



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.




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 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 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 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 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 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 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.