summaryrefslogtreecommitdiff
path: root/.old/delsimpic
diff options
context:
space:
mode:
Diffstat (limited to '.old/delsimpic')
-rwxr-xr-x.old/delsimpic39
1 files changed, 0 insertions, 39 deletions
diff --git a/.old/delsimpic b/.old/delsimpic
deleted file mode 100755
index 83c3d1a..0000000
--- a/.old/delsimpic
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/awk -f
-function convtobytes(num) {
- if (match(num, " K"))
- mul = 1000
- else if (match(num, " M"))
- mul = 1000 * 1000
- else if (match(num, " G"))
- mul = 1000 * 1000 * 1000
- else
- mul = 1
- return int(num * mul)
-}
-
-BEGIN {
- cmd = "czkawka_cli image -d $PWD"
- FS = " - "
- largestsize = 0
- imc = 0
- k = 0
- while (cmd | getline) {
- print $0
- if (!match($0, "^/")) {
- delete images
- largestsize = 0
- imc = 0
- k++
- break
- }
- images[$imc] = $0
- if (size = convtobytes($3) > largestsize) {
- largestsize = size
- keep[$k] = $1
- }
- imc++
- }
- for (image in keep) {
- print $image
- }
-}