Open zormit opened 3 years ago
Interesting! Thanks for the report, @zormit - also hi, good to hear from you! :blue_heart:
According to the changelog, scrot added the --overwrite
argument in the 1.0 release. The packaged versions distributed in Ubuntu 20.04 and Debian Buster include this change; previous OS versions packaged older versions of scrot without --overwrite
. That's why I hadn't noticed it before, then!
As part of the PR introducing --overwrite
, the default behavior was changed from silently overwriting to silently using another name; that's a slightly unfortunate change, but it was clearly communicated by incrementing the major version number.
Fortunately, this exact use-case is addressed in a comment on a follow-up issue! The backwards-compatible fix, then, should be to add --dry-run
to the call to mktemp
- this should work on both the old and new versions.
@zormit, if you're interested, I'd love to see that in a pull request!
A small addendum: adding the --overwrite
argument to an old version causes additional output to be printed:
scrot: unrecognized option '--overwrite'
Which would mean an email every 5 minutes, assuming cron is set up to email output (which it does by default) and that the system has email set up (which is less common on desktops).
Not sure if this is for every setup, so I'm creating an issue instead of a PR: I had to change the following to make it work for me:
otherwise,
pngcrush
did not find${TEMPFILE}
, asscrot
modified the filename by adding a suffix.