grimblast : Errors when using --freeze and area
When I try using the --freeze argument with the area option, I get errors, then it freezes without the gray overlay. When I click it freezes on an image half a second later than the first freeze, and if I want to screenshot I have to keep pressing the left click and select the area with the right click.
grimblast check returns all OK.
errors when executing the command :
parse error: Invalid numeric literal at line 1, column 28
parse error: Invalid numeric literal at line 1, column 28
parse error: Invalid numeric literal at line 1, column 28
jq: invalid JSON text passed to --argjson
Use jq --help for help with command-line options,
or see the jq manpage, or online docs at https://stedolan.github.io/jq
error after taking the screenshot :
/usr/bin/grimblast: line 197: kill: (355954) - No such process
Hmm, kill should be in the coreutils package. Do you not have that installed?
No I have kill, i think it just doesn't find the process it's supposed to kill
Hmm, it must be because hyprpicker and slurp are in a race condition. I think slurp starts faster and thus when you press click again, hyprpicker gets killed. So the process that was supposed to be killed exited before the code reached it.
You could try adjusting the sleep period on line 179, set it to 0.5 maybe. If it helps, I'll increase it.
It doesn't work, I went up to sleep 2 but it just delays the problem. Though I found out that if I click right during the sleep period it works correctly (still outputing the same errors though)
So the jq errors still persist? The only mention of --argjson in the code is for window selection.
What is your Hyprland version?
Ah I forgot to specify that, would have been an interesting information to have, but I don't use Hyprland, I use sway. I was told it would work anyway since both use wlroots
It does not. It requires hyprctl to get the windows (akin to swaymsg -t get_tree). Since you're not on Hyprland, the command fails and brings the whole script down. The rest of the commands should work though (except area and active).
Well hyprpickr alone works fine though. At the very least I could make my own screenshot script I think
Maybe I could check whether HYPRLAND_INSTANCE_SIGNATURE is set before trying to get the windows list.
I think I'll have more chances trying to implement the same solution with hyprpicker with grimshot I think ? Or at least make my own script with grim and slurp
Sure, that could work. The commit where I added the --freeze argument is pretty small, so you can use that to adapt grimshot.
Okay I'll do that thanks !