~vonfry/dotfiles

6bba02466940223a77d8ab07f1f700b65247a17b — Vonfry 5 months ago d2534f7
emacs/dashboard: find fortune before set messages
1 files changed, 12 insertions(+), 11 deletions(-)

M etc/nixos/modules/user/files/emacs.d/modules/interface/dashboard/func.el
M etc/nixos/modules/user/files/emacs.d/modules/interface/dashboard/func.el => etc/nixos/modules/user/files/emacs.d/modules/interface/dashboard/func.el +12 -11
@@ 14,14 14,15 @@

(defun +dashboard/set-fortune ()
  (interactive)
  (setq dashboard-footer-messages
        (list
         (replace-regexp-in-string
          (rx (+ (| (| space blank) "\n")))
          " "
          (replace-regexp-in-string
           (rx 27 "[" (* (| digit ";")) alpha (? 29))
           ""
           (shell-command-to-string
            (format "fortune -s %s all"
                    (expand-file-name "fortunes" (xdg-data-home)))))))))
  (when (executable-find "fortune")
    (setq dashboard-footer-messages
          (list
           (replace-regexp-in-string
            (rx (+ (| (| space blank) "\n")))
            " "
            (replace-regexp-in-string
             (rx 27 "[" (* (| digit ";")) alpha (? 29))
             ""
             (shell-command-to-string
              (format "fortune -s %s all"
                      (expand-file-name "fortunes" (xdg-data-home))))))))))