From dee619824a9d5286be5b6c27b3fa16cf4142385f Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 10 Jun 2022 01:55:16 +0100 Subject: jao-dirmon tweaks --- init.el | 5 ++--- lib/eos/jao-dirmon.el | 10 +++++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/init.el b/init.el index 5ce1c21..dee3cbc 100644 --- a/init.el +++ b/init.el @@ -234,9 +234,8 @@ suffixes))) ;;;; disk monitoring -(when (featurep 'multisession) - (use-package jao-dirmon)) - +(use-package jao-dirmon + :commands jao-dirmon-report) ;;; Crypto ;;;; PGP, EPG, passwords (setq epg-pinentry-mode 'loopback) diff --git a/lib/eos/jao-dirmon.el b/lib/eos/jao-dirmon.el index 4fb8609..894d740 100644 --- a/lib/eos/jao-dirmon.el +++ b/lib/eos/jao-dirmon.el @@ -34,11 +34,11 @@ (defun jao-dirmon-sizes () (mapcar (lambda (f) - (let ((x (split-string (jao-shell-string "du -s" f)))) - (cons (cadr x) (string-to-number (car x))))) + (let ((x (split-string (jao-shell-string "du -b -s" f)))) + (cons (cadr x) (/ (string-to-number (car x)) 1024 1024)))) (jao-dirmon-dirs))) -(defvar jao-dirmon-threshold 100000) +(defvar jao-dirmon-threshold 100) (defvar jao-dirmon-last-delta nil) ;;;###autoload @@ -49,10 +49,10 @@ (high ())) (dolist (c current) (let ((d (- (cdr c) (alist-get (car c) old 0 nil #'string=)))) - (when (> d jao-dirmon-threshold) + (when (> d jao-dirmon-threshold) (push c high)))) (setq jao-dirmon-last-delta high) - (let ((prompt (format"High deltas: %s. Save state?" high))) + (let ((prompt (format "High deltas: %s. Save state?" high))) (when (y-or-n-p prompt) (setf (multisession-value jao-dirmon-last) current))) jao-dirmon-last-delta)) -- cgit v1.2.3