You are not logged in.

#1 2012-08-19 13:49:26

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

[SOLVED]calling "scrot -s from awesome's rc.lua doesnt work

I've tried using awful.util.spawn and spawn_with_shell both on a bash script and with the scrot command in quotes.
In all cases the 'normal' scrot command (entire screen) works, but scrot -s does not. The cursor icon never changes, and I'm not enabled to to draw a window to capture.
Any ideas? I'm quite at a loss here smile
here are a few examples of what i've tried so far:

awful.key({}        , "#107", function() awful.util.spawn_with_shell("scrot -s -e 'mv $f /home/bladt/.tmp/screenshots'") end),
--awful.key({}        , "#107", function () awful.util.spawn("/home/bladt/.config/awesome/helpers/scrdump -s " .. SCRDUMPPATH) end),
--awful.key({ "Mod1" }, "#107", function () awful.util.spawn("/home/bladt/.config/awesome/helpers/scrdump " .. SCRDUMPPATH) end),

EDIT - The solution:
add

sleep 1

before the call to scrot.

Last edited by Bladtman242 (2013-01-21 10:54:30)

Offline

#2 2012-08-19 18:50:51

kastagir
Member
From: Mielec, PL
Registered: 2011-06-04
Posts: 7

Re: [SOLVED]calling "scrot -s from awesome's rc.lua doesnt work

I couldn't make 'scrot -s' work with a hotkey. I looked for an answer for a long time but I think it's a scrot bug. This:

xwd -screen | convert - "$HOME/pictures/$(date +%Y%m%d-%H%M%S).png"

does something similar. Unfortunately It only captures pointed window. You can't draw a rectangle an screen to grab that area.

Last edited by kastagir (2012-08-19 18:57:04)

Offline

#3 2012-08-19 19:44:37

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED]calling "scrot -s from awesome's rc.lua doesnt work

I guess I should consider xwd then smile
I could probably live with capturing the entire window, but if possible I'd rather make it work with scrot.
It works perfectly well from the super + r lua prompt, so why not from rc.lua?
As far as I can tell, awful.util.spawn runs as my user, and from my home directory.
maybe its a problem with catching the X session or something?

Offline

#4 2013-01-19 22:22:57

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED]calling "scrot -s from awesome's rc.lua doesnt work

Playing with spectrwm i noticed that the script they use for calling scrot -s calls sleep1
before calling scrot itself.
This works for awesome as well.

Offline

#5 2013-01-19 23:58:37

anonymous_user
Member
Registered: 2009-08-28
Posts: 3,059

Re: [SOLVED]calling "scrot -s from awesome's rc.lua doesnt work

Thank you so much!!!!

I noticed this problem before and I'm so happy to have a solution:

https://bbs.archlinux.org/viewtopic.php?id=107631

Offline

#6 2013-01-20 03:15:22

Kebertx
Member
Registered: 2012-01-02
Posts: 69

Re: [SOLVED]calling "scrot -s from awesome's rc.lua doesnt work

    awful.key({                   }, "Print", function () awful.util.spawn("scrot -e 'mv $f " .. home .."/Pictures/scrots/ 2>/dev/null'") end),

This line in my rc.lua takes screenshots faithfully. Hope it helps...

Offline

#7 2013-01-21 10:48:32

Bladtman242
Member
Registered: 2012-02-14
Posts: 127

Re: [SOLVED]calling "scrot -s from awesome's rc.lua doesnt work

Kebert: the problem here applies only to "scrot -s" smile, but thanks for the input wink

anonymous_user: No problem, that's exactly how I felt when I found out!
I sure would like to know why that works though.
I could understand if the call to scrot was unblocking (which it isn't), and sleeping after the call would help, but sleeping prior to calling scrot seems weird.
Maybe something environmental that takes a moment to load up?

Last edited by Bladtman242 (2013-01-21 10:52:10)

Offline

Board footer

Powered by FluxBB