]> zdv2.bktei.com Git - BK-2020-03.git/commitdiff
feat(user/gthumb/mvall.org):Add gThumb command
authorSteven Baltakatei Sandoval <baltakatei@gmail.com>
Tue, 16 Jun 2026 21:18:58 +0000 (21:18 +0000)
committerSteven Baltakatei Sandoval <baltakatei@gmail.com>
Tue, 16 Jun 2026 21:18:58 +0000 (21:18 +0000)
- Note: version 0.0.1

user/gthumb/mvall.org [new file with mode: 0644]

diff --git a/user/gthumb/mvall.org b/user/gthumb/mvall.org
new file mode 100644 (file)
index 0000000..af4319b
--- /dev/null
@@ -0,0 +1,48 @@
+#+AUTHOR: Steven Baltakatei Sandoval
+#+DATE: 2026-06-16
+#+TITLE: mvall
+#+VERSION: 0.0.1
+
+This command moves to trash a single selected file ~dir1/file123.ext~
+along with any adjacent files that share the same stem located within
+the same directory (e.g. ~dir1/file123.*~). Also moved are matching
+files in directories neighboring the originalʼs parent directory
+(e.g. ~dir2/file123.*~).  The destination trash directory is ~.trash~.
+
+Keyboard shortcut: ~Shift + T~
+
+This is useful for pruning photos with multiple format extensions with
+each extension type in a separate directory.  For example, a ~JPG/~
+directory contains ~JPG/DSC01001.JPG~, ~JPG/DSC01001.JPG.ots~ and a
+~ARW/~ directory contains ~ARW/DSC01001.ARW~. With ~JPG/DSC01001.JPG~
+selected and the ''rmall'' command executed within [[gThumb]], a ~.trash~
+directory is created next to ~JPG/~ and ~ARW/~. Then, the following
+moves are performed:
+
+- ~JPG/DSC01001.JPG~ is moved to ~.trash/DSC01001.JPG~
+- ~JPG/DSC01001.JPG.ots~ is moved to ~.trash/DSC01001.JPG.ots~
+- ~ARW/DSC01001.ARW~ is moved to ~.trash/DSC01001.ARW~
+
+Thus, by browsing ~JPG/~ in [[gThumb]] and performing *rmall* on undesired
+photos, the unwanted related photos from not only ~JPG/~, ~ARW/~ and
+other similar directories are prepared for disposal in ~.trash~.
+
+Line-by-line view:
+#+BEGIN_EXAMPLE
+# rmall v0.0.1
+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;
+#+END_EXAMPLE
+
+Paste-ready view:
+#+begin_example
+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;
+#+end_example