Replies: 6 comments 3 replies
-
Seems reasonable. Part of resurrection is trimming dead branches off of the tree. |
Beta Was this translation helpful? Give feedback.
-
Agreed. This is something more appropriate for an image editor instead of a screenshotting tool. |
Beta Was this translation helpful? Give feedback.
-
I agree as well. It doesn't belong in scrot. The fact that removing it would also make the code smaller and better, that's a nice bonus. P.S. Speaking of dead branches, what do you think about the thumbnail, the countdown, the command execution and the imlib2 script? Here are my thoughts against them:
|
Beta Was this translation helpful? Give feedback.
-
I'm indifferent to this one. It's probably out of scope, true. Being too aggressive about removing what is out of scope doesn't help either, though. For instance, scrot is definitely not an image encoder, but we don't limit ourselves to outputting bitmaps and leaving image encoding to another program.
I would actually have scrot always countdown when a delay is used, the image isn't being output to stdout, and stdout is a TTY. That seems like an elegant solution to me. Also, the current delay code suffers from drift. It calls sleep() in a loop, time passes between each sleep() call. It should use the POSIX setitimer() function instead which doesn't suffer from this issue.
Yes. This feature actually interferes with capability limitation frameworks like FreeBSD's capsicum and OpenBSD's pledge() and unveil(). I intend to add support for those plus at least the Linux landlock and possibly its seccomp() too at some point. "-e" isn't actually useful because shell pipelines exist, it's just code that shouldn't be there. The implementation also uses the system() function which should never be used. I would instead have scrot always print the filename of the file it created unless the output file is stdout.
I haven't even figured out how to use that one. imlib2 is badly documented and scrot's man page only says the option exists. |
Beta Was this translation helpful? Give feedback.
-
Fair enough. Btw, this is a bit off topic, but speaking of image encoding - I think we can benefit from an option to specify what format you want the image in, in-case you don't specify a filename and just dump it to stdout for example.
Interesting. Would you mind explaining your use case for the countdown? How/when do you find it useful? I'm not saying it is. I just didn't think it was used, so I'm curious how you use it.
To be honest, I'm not sure how I feel about scrot outputting the filename. Usually you know what the filename is, either because you've set it, or if you haven't you know the default format, so I think it's a bit pointless implementing it. If it does get implemented however, perhaps as an optional parameter instead of doing it by default? Also, I haven't heard about capability limiting frameworks before. What's the idea there?
Honestly, same. I am guessing the idea is to make imlib2 do some processing on the image or something. |
Beta Was this translation helpful? Give feedback.
-
Honestly, I don't really like a couple of the ideas:
If do we those two, I plan on forking scrot so I can remove those two, and use that version. I love the idea of the feature limiting frameworks, but do we actually need it? I mean I get the idea and I like it, however, if you are going to trust the code more because it uses such framework, you'll need to read the code and see that it does, so you have to read the code either way. On the other hand, if you want to include malicious code, you will just remove the framework usage. Is there a practical reason we need this? Like wanting scrot to work on a certain OS, and it not being possible because software without such framework is required, or? |
Beta Was this translation helpful? Give feedback.
-
My 2 main grudges with it are that its interface is very clunky and that it's out of a screenshot program's scope.
The manual's example already shows some of that:
scrot -n "-f '/usr/share/fonts/TTF/DroidSans-Bold/40' -x 10 -y 20 -c 255,0,0,255 -t 'Hi'"
The entire argument to -n needs to be quoted so getopt_long() doesn't confuse it with one of its flags.
The user has to point scrot towards a font file instead of a font name because it doesn't use fontconfig to pick the font.
The syntax unnecessarily differs from other syntaxes used in scrot, such as the syntax of the
-s
flag or the-l
flag. Really, all of those should just use the POSIX getsubopt() function instead.I've actually needed an annotation feature in the past, but I used ImageMagick for it:
$ convert 2022-09-04-194335_956x536_scrot.png -pointsize 70 -fill Plum -stroke Gold -strokewidth 3 -gravity NorthEast -annotate +10+10 'test' out.png
ImageMagick's interface seems a little better, too, so I suggest removing annotations from scrot and leaving that to a different program. Would that be acceptable?
Beta Was this translation helpful? Give feedback.
All reactions