]> zdv2.bktei.com Git - BK-2020-03.git/commitdiff
feat(user/gthumb/):Update keep (→v0.0.2)and rmall (→v0.0.5)
authorSteven Baltakatei Sandoval <baltakatei@gmail.com>
Tue, 16 Jun 2026 22:24:30 +0000 (22:24 +0000)
committerSteven Baltakatei Sandoval <baltakatei@gmail.com>
Tue, 16 Jun 2026 22:24:30 +0000 (22:24 +0000)
- Note: Add debug code.

user/gthumb/keep.org
user/gthumb/rmall.org

index f8140b693db678582151555b0cfb8fd816a4e9e7..c5548cd0e480800ebdf1cdb820655b0dda63caf5 100644 (file)
@@ -12,9 +12,10 @@ The destination trash directory is ~keep~; parent directories ~JPG/~
 and ~ARW/~ (e.g. ~dir1~, ~dir2~) are preserved within ~keep/~.
 
 ** Stats
 and ~ARW/~ (e.g. ~dir1~, ~dir2~) are preserved within ~keep/~.
 
 ** Stats
-Version: 0.0.1
+Version: 0.0.2
+License: GPLv3+
 gThumb version: ~3.12.6~
 gThumb version: ~3.12.6~
-Suggested keyboard shortcut: ~Shift + T~
+Suggested keyboard shortcut: ~Shift + K~
 
 ** Usage
 *keep* is useful for pruning photos with multiple format extensions
 
 ** Usage
 *keep* is useful for pruning photos with multiple format extensions
@@ -36,25 +37,40 @@ other similar directories are moved for preservation in ~keep/~.
 Then, it is upon the user to archive the contents of ~keep/~ to.
 
 ** Code
 Then, it is upon the user to archive the contents of ~keep/~ to.
 
 ** Code
+Paste the code below into the ~Command~ field of the ~Edit Command~
+window under 🔧 → Personalize… .
+
 Line-by-line view:
 #+BEGIN_EXAMPLE
 Line-by-line view:
 #+BEGIN_EXAMPLE
-# keep v0.0.1
-dbf=/tmp/gtlogkeep.txt;
-f="%F";
+# keep v0.0.2
+fdebug=/tmp/gtlogkeep.txt;
+f=%F;
 fBase="$(basename "$f")";
 fne="${fBase%.*}";
 dppar="$(dirname %P)";
 dKeep="${dppar}/keep";
 fBase="$(basename "$f")";
 fne="${fBase%.*}";
 dppar="$(dirname %P)";
 dKeep="${dppar}/keep";
-dKeepJpg="${dKeep}/JPG/";
-dKeepArw="${dKeep}/ARW/";
-mkdir -p "$dKeep" "$dKeepJpg" "$dKeepArw";
-printf "%s\n" "$dbf" "$f" "$fBase" "$fne" "$dppar" "$dKeep" 1>"$dbf" 2>&1;
-mv -n -t "$dKeepJpg" "${dppar}/"*"/${fne}.JPG"*;
-mv -n -t "$dKeepArw" "${dppar}/"*"/${fne}.ARW"*;
+printf "DEBUG:fdebug:%s\n" "$fdebug" 1>>"$fdebug" 2>&1;
+printf "DEBUG:f:%s\n" "$f" 1>>"$fdebug" 2>&1;
+printf "DEBUG:fBase:%s\n" "$fBase" 1>>"$fdebug" 2>&1;
+printf "DEBUG:fne:%s\n" "$fne" 1>>"$fdebug" 2>&1;
+printf "DEBUG:dppar:%s\n" "$dppar" 1>>"$fdebug" 2>&1;
+printf "DEBUG:dKeep:%s\n" "$dKeep" 1>>"$fdebug" 2>&1;
+for fsrc in "${dppar}"/*/"${fne}".*; do
+  if [ ! -e "$fsrc" ]; then continue; fi;
+  sdname="$(basename "$(dirname "$fsrc")" )";
+  ddest="${dKeep}/${sdname}";
+  printf "DEBUG:fsrc:%s\n" "$fsrc";
+  printf "DEBUG:sdname:%s\n" "$sdname";
+  printf "DEBUG:ddest:%s\n" "$ddest";
+  echo "foo" 1>>"$fdebug" 2>&1;
+  if [ ! -d "$ddest" ]; then
+    printf "DEBUG:Destination dir does not exist. Creating:%s\n" "$ddest";
+    mkdir -p "$ddest";
+  else
+    printf "DEBUG:Destination dir exists:%s\n" "$ddest";
+  fi;
+  printf "STATUS: Moving %s → %s\n" "$fsrc" "$ddest/";
+  mv -n "$fsrc" "$ddest/";
+done 1>>"$fdebug" 2>&1;
 sleep 1;
 #+END_EXAMPLE
 sleep 1;
 #+END_EXAMPLE
-
-Paste-ready view:
-#+begin_example
-dbf=/tmp/gtlogkeep.txt; f="%F"; fBase="$(basename "$f")"; fne="${fBase%.*}"; dppar="$(dirname %P)"; dKeep="${dppar}/keep"; dKeepJpg="${dKeep}/JPG/"; dKeepArw="${dKeep}/ARW/"; mkdir -p "$dKeep" "$dKeepJpg" "$dKeepArw"; printf "%s\n" "$dbf" "$f" "$fBase" "$fne" "$dppar" "$dKeep" 1>"$dbf" 2>&1; mv -n -t "$dKeepJpg" "${dppar}/"*"/${fne}.JPG"*; mv -n -t "$dKeepArw" "${dppar}/"*"/${fne}.ARW"*; sleep 1;
-#+end_example
index c973e261d5fd420532853a3526933a0607a86c2d..7b25fdc3b2cb1a048ffa247e7e5f8fa69704cf6d 100644 (file)
@@ -12,7 +12,8 @@ parent directories (e.g. ~dir1~, ~dir2~) are preserved within
 ~.trash/~.
 
 ** Stats
 ~.trash/~.
 
 ** Stats
-Version: 0.0.4
+Version: 0.0.5
+License: GPLv3+
 gThumb version: ~3.12.6~
 Suggested keyboard shortcut: ~Shift + T~
 
 gThumb version: ~3.12.6~
 Suggested keyboard shortcut: ~Shift + T~
 
@@ -39,34 +40,34 @@ permanently delete them.
 ** Code
 Line-by-line view:
 #+BEGIN_EXAMPLE
 ** Code
 Line-by-line view:
 #+BEGIN_EXAMPLE
-# rmall v0.0.4
-dbf=/tmp/gtlog.txt;
-f="%F";
+# rmall v0.0.5
+fdebug=/tmp/gtlog.txt;
+f=%F;
 fBase="$(basename "$f")";
 fne="${fBase%.*}";
 dppar="$(dirname %P)";
 dtrash="${dppar}/.trash";
 fBase="$(basename "$f")";
 fne="${fBase%.*}";
 dppar="$(dirname %P)";
 dtrash="${dppar}/.trash";
-printf "%s\n" "$dbf" "$f" "$fBase" "$fne" "$dppar" "$dtrash" 1>"$dbf" 2>&1;
-for fsrc in "${dppar}/"*"/${fne}".*; do
+printf "DEBUG:fdebug:%s\n" "$fdebug" 1>>"$fdebug" 2>&1;
+printf "DEBUG:f:%s\n" "$f" 1>>"$fdebug" 2>&1;
+printf "DEBUG:fBase:%s\n" "$fBase" 1>>"$fdebug" 2>&1;
+printf "DEBUG:fne:%s\n" "$fne" 1>>"$fdebug" 2>&1;
+printf "DEBUG:dppar:%s\n" "$dppar" 1>>"$fdebug" 2>&1;
+printf "DEBUG:dtrash:%s\n" "$dtrash" 1>>"$fdebug" 2>&1;
+for fsrc in "${dppar}"/*/"${fne}".*; do
   if [ ! -e "$fsrc" ]; then continue; fi;
   sdname="$(basename "$(dirname "$fsrc")")";
   ddest="${dtrash}/${sdname}";
   if [ ! -e "$fsrc" ]; then continue; fi;
   sdname="$(basename "$(dirname "$fsrc")")";
   ddest="${dtrash}/${sdname}";
-  printf "fsrc:%s\n" "$fsrc";
-  printf "sdname:%s\n" "$sdname";
-  printf "ddest:%s\n" "$ddest";
+  printf "DEBUG:fsrc:%s\n" "$fsrc";
+  printf "DEBUG:sdname:%s\n" "$sdname";
+  printf "DEBUG:ddest:%s\n" "$ddest";
   if [ ! -d "$ddest" ]; then
   if [ ! -d "$ddest" ]; then
-      printf "DEBUG:ddest does not exist:%s" "$ddest";
+      printf "DEBUG:Destination dir does not exist. Creating:%s\n" "$ddest";
       mkdir -p "$ddest";
   else
       mkdir -p "$ddest";
   else
-      printf "DEBUG:ddest exists:%s" "$ddest";
+      printf "DEBUG:Destination dir exists:%s\n" "$ddest";
   fi;
   printf "STATUS: Moving %s → %s\n" "$fsrc" "$ddest/";
   mv -n "$fsrc" "$ddest/";
   fi;
   printf "STATUS: Moving %s → %s\n" "$fsrc" "$ddest/";
   mv -n "$fsrc" "$ddest/";
-done 1>>"$dbf" 2>&1;
+done 1>>"$fdebug" 2>&1;
 sleep 1;
 #+END_EXAMPLE
 sleep 1;
 #+END_EXAMPLE
-
-Paste-ready view:
-#+begin_example
-dbf=/tmp/gtlog.txt; f="%F"; fBase="$(basename "$f")"; fne="${fBase%.*}"; dppar="$(dirname %P)"; dtrash="${dppar}/.trash"; printf "%s\n" "$dbf" "$f" "$fBase" "$fne" "$dppar" "$dtrash" 1>"$dbf" 2>&1; for fsrc in "${dppar}/"*"/${fne}".*; do   if [ ! -e "$fsrc" ]; then continue; fi;   sdname="$(basename "$(dirname "$fsrc")")";   ddest="${dtrash}/${sdname}";   printf "fsrc:%s\n" "$fsrc";   printf "sdname:%s\n" "$sdname";   printf "ddest:%s\n" "$ddest";   if [ ! -d "$ddest" ]; then       printf "DEBUG:ddest does not exist:%s" "$ddest";       mkdir -p "$ddest";   else       printf "DEBUG:ddest exists:%s" "$ddest";   fi;   printf "STATUS: Moving %s → %s\n" "$fsrc" "$ddest/";   mv -n "$fsrc" "$ddest/"; done 1>>"$dbf" 2>&1; sleep 1;
-#+end_example