Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grimblast : Errors when using --freeze and area #47

Open
Absobel opened this issue Jun 22, 2023 · 12 comments
Open

grimblast : Errors when using --freeze and area #47

Absobel opened this issue Jun 22, 2023 · 12 comments

Comments

@Absobel
Copy link

Absobel commented Jun 22, 2023

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

@fufexan
Copy link
Member

fufexan commented Jun 22, 2023

Hmm, kill should be in the coreutils package. Do you not have that installed?

@Absobel
Copy link
Author

Absobel commented Jun 22, 2023

No I have kill, i think it just doesn't find the process it's supposed to kill

@fufexan
Copy link
Member

fufexan commented Jun 22, 2023

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.

@Absobel
Copy link
Author

Absobel commented Jun 22, 2023

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)

@fufexan
Copy link
Member

fufexan commented Jun 22, 2023

So the jq errors still persist? The only mention of --argjson in the code is for window selection.
What is your Hyprland version?

@Absobel
Copy link
Author

Absobel commented Jun 22, 2023

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

@fufexan
Copy link
Member

fufexan commented Jun 22, 2023

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

@Absobel
Copy link
Author

Absobel commented Jun 22, 2023

Well hyprpickr alone works fine though. At the very least I could make my own screenshot script I think

@fufexan
Copy link
Member

fufexan commented Jun 22, 2023

Maybe I could check whether HYPRLAND_INSTANCE_SIGNATURE is set before trying to get the windows list.

@Absobel
Copy link
Author

Absobel commented Jun 22, 2023

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

@fufexan
Copy link
Member

fufexan commented Jun 22, 2023

Sure, that could work. The commit where I added the --freeze argument is pretty small, so you can use that to adapt grimshot.

@Absobel
Copy link
Author

Absobel commented Jun 22, 2023

Okay I'll do that thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants