summaryrefslogtreecommitdiffhomepage
path: root/lib/eos
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-15 13:34:35 +0100
committerjao <jao@gnu.org>2022-09-15 13:34:35 +0100
commit17ab47eb1d913491401d5918cda6e20ac00513e8 (patch)
treede4ec67c9b22b6ac948db6523a1fb9d155ba18ca /lib/eos
parent33ba3841223d461854e63245620374be20e74ed4 (diff)
downloadelibs-17ab47eb1d913491401d5918cda6e20ac00513e8.tar.gz
elibs-17ab47eb1d913491401d5918cda6e20ac00513e8.tar.bz2
jao-dirmon: fixes and little improvements to results display
Diffstat (limited to 'lib/eos')
-rw-r--r--lib/eos/jao-dirmon.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/eos/jao-dirmon.el b/lib/eos/jao-dirmon.el
index a2535ad..ab267fc 100644
--- a/lib/eos/jao-dirmon.el
+++ b/lib/eos/jao-dirmon.el
@@ -34,8 +34,8 @@
(defun jao-dirmon-sizes ()
(mapcar (lambda (f)
- (let ((x (split-string (jao-shell-string "du -b -s" f))))
- (cons (cadr x) (/ (string-to-number (car x)) 1024 1024))))
+ (let ((x (split-string (jao-shell-string "du -BM -s" f))))
+ (cons (cadr x) (string-to-number (car x)))))
(jao-dirmon-dirs)))
(defvar jao-dirmon-threshold 100)
@@ -43,9 +43,13 @@
(defun jao-dirmon--show-deltas (old current deltas)
(with-temp-buffer
- (insert "High deltas since " (car old) "\n------------------\n\n")
+ (insert "High deltas since " (car old) "\n\n")
(dolist (d deltas)
- (insert d "\n"))
+ (insert (format "- %s: %s Mb\n" (car d) (cdr d))))
+ (insert "\n\nSizeable dirs\n\n")
+ (dolist (c (seq-sort-by #'cdr #'> current))
+ (when (> (cdr c) jao-dirmon-threshold)
+ (insert (format "- %s: %s Mb\n" (car c) (cdr c)))))
(beginning-of-buffer)
(pop-to-buffer (current-buffer) nil t)
(when (y-or-n-p "Save current state?")