From f199adb36725eba9284376982d1fdd7403d6bded Mon Sep 17 00:00:00 2001 From: kj Date: Sat, 8 Feb 2025 16:25:58 -0300 Subject: [PATCH] Improve agenda/items load on dashboard. --- configs/init-packages.el | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/configs/init-packages.el b/configs/init-packages.el index 2c0ab66..e24f9f2 100644 --- a/configs/init-packages.el +++ b/configs/init-packages.el @@ -58,17 +58,19 @@ ;; Un bonito y sencillo panel de inicio (use-package dashboard :defer t - :init - (dashboard-setup-startup-hook) :hook - (dashboard-after-initialize . (lambda () - "Refrescamos el dashboard con la agenda luego de cargar todo" - (setq dashboard-items '( - ;; (recents . 10) - (agenda . 10) - )) - (dashboard-refresh-buffer) - )) + (elpaca-after-init . (lambda () + "Refrescamos el dashboard con la agenda luego de cargar todo" + (when (< (length command-line-args) 2) + (dashboard-open) + (run-at-time 1 nil (lambda() + "Recargamos el buffers con los items de manera asincrónica" + (setq dashboard-items '( + ;; (recents . 10) + (agenda . 10) + )) + (dashboard-refresh-buffer))) ;; Refrescamos el buffer sin bloquear emacs + ))) :config (setq dashboard-set-file-icons t dashboard-set-heading-icons t