selectool.1 (3892B)
1 .Dd July 12, 2026 2 .Dt SELECTOOL 1 3 .Os 4 .Sh NAME 5 .Nm selectool 6 .Nd image selection tool 7 .Sh SYNOPSIS 8 .Nm 9 .Op Ar -ms 10 .Op Ar -f format 11 .Op Ar -w width 12 .Op Ar -c color 13 .Op Ar -z size 14 .Ar file ... 15 .Sh DESCRIPTION 16 .Nm 17 shows each of the given images and allows them to be selected or deselected. 18 When the keyboard command 19 .Sq q 20 is used to exit, the given command is printed for each of the selected images. 21 .Sh OPTIONS 22 .Bl -tag -width Ds 23 .It Fl m 24 Disable automatic redrawing when the window is resized (the 25 .Fl m 26 stands for 'manual'). 27 This may be useful on older machines that start accelerating global 28 warming when the image is redrawn constantly while resizing. 29 Note that this also disables exposure events, so the window has to be 30 manually redrawn when switching back to it from another window. 31 .It Fl s 32 Select all images by default. 33 .It Fl f Ar format 34 Set the format to be used when the commands are output. 35 See 36 .Sx OUTPUT FORMAT 37 for details. 38 .It Fl w Ar width 39 Set the line width of the cross that is drawn over selected images 40 in pixels (valid values: 1-99). 41 Default: 5. 42 .It Fl c Ar color 43 Set the color of the cross that is drawn over selected images. 44 Default: #FF0000. 45 .It Fl z Ar size 46 Set the Imlib2 in-memory cache to 47 .Ar size 48 MiB (valid values: 0-1024). 49 Default: 4. 50 .El 51 .Sh OUTPUT FORMAT 52 The command for each selected image is output using the format given by 53 .Fl f , 54 or the default of 55 .Ql rm -- '%f' . 56 .Pp 57 The following substitutions are performed: 58 .Bl -tag -width Ds 59 .It %% 60 Print 61 .Ql % . 62 .It %f 63 Print the filename of the image. 64 Warning: This is printed as is, without any escaping. 65 .El 66 .Pp 67 If an unknown substitution is encountered, a warning is printed to 68 standard error and the characters are printed verbatim. 69 .Sh KEYBOARD COMMANDS 70 .Bl -tag -width Ds 71 .It ARROW LEFT 72 Go to the previous image. 73 .It ARROW RIGHT 74 Go to the next image. 75 .It RETURN 76 Deselect the current image and go to the next image. 77 .It SHIFT + RETURN 78 Deselect the current image and go to the previous image. 79 .It d 80 Select the current image and go to the next image. 81 .It D 82 Select the current image and go to the previous image. 83 .It t 84 Toggle the selection status of the current image. 85 .It SPACE 86 Redraw the window. 87 This is useful when automatic redrawing is disabled with 88 .Fl m . 89 .It q 90 Exit the program, printing the set command for all selected images. 91 If the window is closed through some other means, no commands are printed. 92 .El 93 .Sh EXIT STATUS 94 .Ex -std 95 .Sh EXAMPLES 96 Normal usage to delete selected images: 97 .Bd -literal 98 $ selectool *.jpg > tmp.sh 99 $ sh tmp.sh 100 .Ed 101 .Pp 102 Or, if you're brave: 103 .Bd -literal 104 $ selectool *.jpg | sh 105 .Ed 106 .Pp 107 The original use case for 108 .Nm 109 was to quickly delete images that have been recovered using programs like 110 .Xr photorec 8 111 or 112 .Xr foremost 8 . 113 When used on a system partition, these programs generally recover a lot of 114 images that aren't important, which then need to be sorted manually. 115 Other programs that the author used for this task in the past were not ideal 116 because they either were much too slow or allowed mistakes to be made too 117 easily by deleting images immediately. 118 .Pp 119 It is also possible to do more advanced things. 120 For instance, to move the selected images into a different directory, 121 something like this can be done: 122 .Bd -literal 123 $ selectool -f "mv -- '%f' '/path/to/dir/'" *.jpg | sh 124 .Ed 125 .Pp 126 Note that no great care has been taken to deal with filenames containing 127 single quotes. 128 That is left as an exercise to the reader (hint: just don't have 129 filenames containing quotes). 130 .Sh SEE ALSO 131 .Xr croptool 1 , 132 .Xr mv 1 , 133 .Xr rm 1 , 134 .Xr foremost 8 , 135 .Xr photorec 8 136 .Sh AUTHORS 137 .An lumidify Aq Mt nobody@lumidify.org 138 .Sh BUGS 139 The filenames are printed without any escaping, so filenames with 140 quotes may cause issues depending on the output format. 141 .Pp 142 Transparent portions of images should probably be shown differently, 143 but I'm too lazy to fix that and don't really care at the moment.