You are not logged in.
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
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
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
I guess I should consider xwd then
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
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
Thank you so much!!!!
I noticed this problem before and I'm so happy to have a solution:
Offline
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
Kebert: the problem here applies only to "scrot -s" , but thanks for the input
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