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

Partial screenshot functions won't capture GTK apps #2

Closed
ghost opened this issue Mar 16, 2020 · 1 comment
Closed

Partial screenshot functions won't capture GTK apps #2

ghost opened this issue Mar 16, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 16, 2020

Hey, I just came across your script via r/unixporn. Nice one.

I'm having an issue with partial screenshots though. It only occurs when trying to capture GTK applications windows.

When clicking on a GTK app window, It'll just capture a pixel, which seems to be the same color than my window border color (I'm using bspwm). No issue with Qt apps or my terminal windows (kitty).

I guess the culprit is either ffcast or slop because replacing

crtc() {
[...]
  ffcast -q $(slop -n -f '-g %g ') png /tmp/screenshot_clip.png
[...]
}
crtf() {
[...]
  ffcast -q $(slop -n -f '-g %g ') png "$screenshot_directory/$dt.png"
[...]
}

with

rtc() {
[...]
  maim -s -u -m 10 /tmp/screenshot_clip.png
[...]
}
crtf() {
[...]
  maim -s -u -m 10 "$screenshot_directory/$dt.png"
[...]
}

solves the issue.

Maybe it can be fixed without having to install maim, I don't know.

Cheers

@ceuk
Copy link
Owner

ceuk commented Mar 16, 2020

Haha that's funny - I saw the title in my email earlier and thought "hmm I 'll probably just replace those bits with maim then.." but it looks like you beat me to it 😁

I actually just checked while writing this and it works for me when grabbing Nemo on AwesomeWM in Arch. I think Maim uses Slop under the hood so it might be ffcast causing the issue..

Anyway, since I can't recreate I'll just leave this as a workaround for people with the issue rather than add another dependency for everyone.

Thanks for raising :)

@ceuk ceuk closed this as completed Mar 16, 2020
@ceuk ceuk pinned this issue Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant