scrot
                                
                                 scrot copied to clipboard
                                
                                    scrot copied to clipboard
                            
                            
                            
                        scrot -s sometimes captures the white rectangle used when marking an area
Example: http://imgur.com/yH7IwhX here you see a white line on the top and a bit at the left. Happens frequently.
I think this happens because of a redraw on the underlaying window (e.g. Chrome's PDF viewer while hiding its tooolbar). Thus it's more of an X-Server issue rather than a scrot one (I took a quick look through the code for snapping a section of the screen).
I changed the source code (line 275 at main.c) to the following:
/* move rectangle out of screenshot area */  
rect_x = rx -1;  
rect_y = ry -1;  
rect_w = ev.xmotion.x - rect_x +1;  
rect_h = ev.xmotion.y - rect_y +1;
Maybe not the best solution, but it's fine for me.
Screenshot with official version:

Screenshot with my version:

I get the same issue, where of course the line is black instead of white.
See escrotum, slop and maim: https://wiki.archlinux.org/index.php/taking_a_screenshot#scrot
Escrotum is bloated and by definition written on python which is not really a good idea. But at least it has no bug
Same issue here on Debian Buster. @njx4 you seem to have solved that issue with your code. Could you please submit a PR?
+1 have the black top-left border on every single sscreenshot I take with scrot -s on Arch Linux repo scrot; compton and i3.
+1 Same issue here on both ubuntu and arch linux. compton and i3 as in the case of previous user. I killed compton and the issue was solved, but I need compton because of tearing issues. So, does it need to be solved from compton side or scrot?
How can i add njx's changes to my scrot and recompile?
@mindmusclevegan
Apply the patch, then ./configure --prefix="$PWD/build" && make or similar.
You can run it from src/scrot then or make install (will be installed in build with the above prefix).
But that's rather off-topic.
I've found that there is code that is supposed to clear the rectangle already: https://github.com/dreamer/scrot/blob/974fc6b77af4abdec59568efa3e4ff57dae15453/src/main.c#L347-L350
But I've also noticed that the rectangle itself does not behave well over a (changing) urxvt window, and when using a composite manager (compton).
Can confirm, this is still happening on Arch Linux.
$ scrot --version
scrot version 0.8
Same issue with:
$ scrot --version
scrot version 0.8
$ i3 --version
i3 version 4.16.1 (2019-01-27) © 2009 Michael Stapelberg and contributors
$ compton --version
v6.2
$ uname -a
Linux 5.1.5-arch1-2-ARCH #1 SMP PREEMPT Mon May 27 03:37:39 UTC 2019 x86_64 GNU/Linux
Hi all. If you want, you can participate in scrot that is still in development. Please, see the ChangeLog.
This specific bug is not seen, but you can use the new option --freeze, otherwise open a new issue.
For ArchLinux: it is expected that scrot is in the testing branch of Debian, now it is in experimental.
Regards.
it always does that if something updates on the screen while you are selecting something
Just switched to maim because of this.
You can use
scrot -a $(slop -f '%x,%y,%w,%h')
instead of
scrot -s
@GoldsteinE Are you using a different version of scrot? I don't see -a as an option in scrot 0.8.
@Etherealflux
@GoldsteinE Are you using a different version of scrot? I don't see
-aas an option in scrot 0.8.
$ scrot --version
scrot version 1.2
Thanks. This repo must be out of date, then, since I did try building it from source first. I'll look into that more later!
Ehh, it seems I must start actually maintaining this repo again… FYI for all readers: I am not the original author of scrot - only the first person to recover the code from defunct page of an original author and upload it to GitHub. I implemented the feature I needed at the time and that's it.
Last time I checked, all the distributions carry their own version/fork of scrot, so this project does not have one single upstream source.
@GoldsteinE solution worked for me Arch linux, i3wm, compton, scrot + slop from official arch repo
Same issue, version 1.3 @GoldsteinE solution works for me
In my experience, adding -f (freeze) flag circumvents the bug.
scrot -sf
I moved on to Flameshot which has a lot more features and stays lightweight and very simple to use.
can confirm. Still happening on Arch Linux BSPWM + Picom
I can confirm, this also happening on Void Linux what makes it worse and unusable showing outlines: https://i.imgur.com/xWnOj3d.png
with the --freeze option, scrot -fs filename.png fix this issue.
It seems that using slop is a better option for me. I've been using scrot -s -f inside EXWM for a while to get rid of the white lines, but recently that renders my Chrome page to be a white blank if I don't select fast enough. scrot -a $(slop -f '%x,%y,%w,%h') as @GoldsteinE suggested works fine.
Confirmed this issue still exists on void linux with scrot-1.10_1.x86_64-musl
Confirmed this issue still exists on void linux with scrot-1.10_1.x86_64-musl
A good solution is to use -f to freeze the screen. This solves the problem for now
