SELECTOOL(1) | General Commands Manual | SELECTOOL(1) |
selectool
— image
selection tool
selectool |
[-ms] [-f format] [-w width] [-c color] [-z size] file ... |
selectool
shows each of the given images
and allows them to be selected or deselected. On exit, the given command is
printed for each of the files.
-m
-m
stands for 'manual'). This may be useful on
older machines that start accelerating global warming when the image is
redrawn constantly while resizing. Note that this also disables exposure
events, so the window has to be manually redrawn when switching back to it
from another window.-s
-f
format-w
width-c
color-z
sizeThe command for each selected image is output using the format
given by -f
, or the default of
‘rm -- '%f'
’.
The following substitutions are performed:
%
’.If an unknown substitution is encountered, a warning is printed to standard error and the characters are printed verbatim.
-m
.The selectool
utility exits 0 on
success, and >0 if an error occurs.
Normal usage to delete selected images:
$ selectool *.jpg > tmp.sh $ sh tmp.sh
Or, if you're brave:
$ selectool *.jpg | sh
The original use case for selectool
was to
quickly delete images that have been recovered using programs like
photorec(8) or foremost(8). When used on
a system partition, these programs generally recover a lot of images that
aren't important, which then need to be sorted manually. Other programs that
the author used for this task in the past were not ideal because they either
were much too slow or allowed mistakes to be made too easily by deleting
images immediately.
It is also possible to do more advanced things. For instance, to move the selected images into a different directory, something like this can be done:
$ selectool -f "mv -- '%f' '/path/to/dir/'" *.jpg | sh
Note that no great care has been taken to deal with filenames containing single quotes. That is left as an exercise to the reader (hint: just don't have filenames containing quotes).
lumidify <nobody@lumidify.org>
The filenames are printed without any escaping, so filenames with quotes may cause issues depending on the output format.
Transparent portions of images should probably be shown differently, but I'm too lazy to fix that and don't really care at the moment.
May 14, 2024 |