]> zdv2.bktei.com Git - BK-2020-03.git/blob - user/gthumb/mvall.org
feat(user/gthumb/mvall.org):Add gThumb command
[BK-2020-03.git] / user / gthumb / mvall.org
1 #+AUTHOR: Steven Baltakatei Sandoval
2 #+DATE: 2026-06-16
3 #+TITLE: mvall
4 #+VERSION: 0.0.1
5
6 This command moves to trash a single selected file ~dir1/file123.ext~
7 along with any adjacent files that share the same stem located within
8 the same directory (e.g. ~dir1/file123.*~). Also moved are matching
9 files in directories neighboring the originalʼs parent directory
10 (e.g. ~dir2/file123.*~). The destination trash directory is ~.trash~.
11
12 Keyboard shortcut: ~Shift + T~
13
14 This is useful for pruning photos with multiple format extensions with
15 each extension type in a separate directory. For example, a ~JPG/~
16 directory contains ~JPG/DSC01001.JPG~, ~JPG/DSC01001.JPG.ots~ and a
17 ~ARW/~ directory contains ~ARW/DSC01001.ARW~. With ~JPG/DSC01001.JPG~
18 selected and the ''rmall'' command executed within [[gThumb]], a ~.trash~
19 directory is created next to ~JPG/~ and ~ARW/~. Then, the following
20 moves are performed:
21
22 - ~JPG/DSC01001.JPG~ is moved to ~.trash/DSC01001.JPG~
23 - ~JPG/DSC01001.JPG.ots~ is moved to ~.trash/DSC01001.JPG.ots~
24 - ~ARW/DSC01001.ARW~ is moved to ~.trash/DSC01001.ARW~
25
26 Thus, by browsing ~JPG/~ in [[gThumb]] and performing *rmall* on undesired
27 photos, the unwanted related photos from not only ~JPG/~, ~ARW/~ and
28 other similar directories are prepared for disposal in ~.trash~.
29
30 Line-by-line view:
31 #+BEGIN_EXAMPLE
32 # rmall v0.0.1
33 dbf=/tmp/gtlog.txt;
34 f=%F;
35 fbase="$(basename "$f")";
36 fne="$(printf "%s" "$fbase" | rev | cut -d'.' -f2- | rev; )";
37 dppar="$(dirname %P)";
38 dtrash="${dppar}/.trash";
39 mkdir "$dtrash";
40 printf "%s\n" "$dbf" "$f" "$fbase" "$fne" "$dppar" "$dtrash" 1>"$dbf" 2>&1;
41 mv -n -t "$dtrash" "${dppar}/"*"/${fne}".*;
42 sleep 1;
43 #+END_EXAMPLE
44
45 Paste-ready view:
46 #+begin_example
47 dbf=/tmp/gtlog.txt; f=%F; fbase="$(basename "$f")"; fne="$(printf "%s" "$fbase" | rev | cut -d'.' -f2- | rev; )"; dppar="$(dirname %P)"; dtrash="${dppar}/.trash"; mkdir "$dtrash"; printf "%s\n" "$dbf" "$f" "$fbase" "$fne" "$dppar" "$dtrash" 1>"$dbf" 2>&1; mv -n -t "$dtrash" "${dppar}/"*"/${fne}".*; sleep 1;
48 #+end_example