diff --git a/core/siren-core-macos.el b/core/siren-core-macos.el index 59ac4e5..6a4852e 100644 --- a/core/siren-core-macos.el +++ b/core/siren-core-macos.el @@ -22,15 +22,17 @@ ;; When running in GUI mode. (when window-system ;; Set default font based on priority list - (let* ((families '("Menlo Nerd Font Mono" + (let* ((families '("Menlo Nerd Font" + "Menlo Nerd Font Mono" "Menlo for Powerline" "Menlo" "Monaco Nerd Font Mono" "Monaco for Powerline" "Monaco")) + (available (font-family-list)) (family (catch 'found (dolist (f families) - (if (member f (font-family-list)) + (if (member f available) (throw 'found f)))))) (set-face-attribute 'default nil :family family :height 120)) diff --git a/modules/editor/siren-all-the-icons.el b/modules/editor/siren-all-the-icons.el index 33daf82..596e0bc 100644 --- a/modules/editor/siren-all-the-icons.el +++ b/modules/editor/siren-all-the-icons.el @@ -18,29 +18,43 @@ (use-package all-the-icons-ibuffer :after all-the-icons :if window-system - :init - (all-the-icons-ibuffer-mode 1)) + :hook + (ibuffer-mode . all-the-icons-ibuffer-mode)) + +(use-package all-the-icons-dired + :after all-the-icons + :if window-system + :hook + (dired-mode . all-the-icons-dired-mode)) + +(use-package treemacs-all-the-icons + :after (all-the-icons treemacs) + :if window-system + :config + (treemacs-load-theme "all-the-icons")) (use-package all-the-icons-completion - :after (marginalia all-the-icons) + :after (all-the-icons marginalia) :if window-system - :hook (marginalia-mode . all-the-icons-completion-marginalia-setup) - :init - (all-the-icons-completion-mode) + :demand t + :hook + (marginalia-mode . all-the-icons-completion-marginalia-setup) :config + (all-the-icons-completion-mode) + ;; Using original all-the-icons-completion package. (when (fboundp 'all-the-icons-completion-get-file-icon) - ;; Override default category lookup function to add support for - ;; project-buffer and project-file. - (defun all-the-icons-completion-get-icon (cand cat) - "Return the icon for the candidate CAND of completion category CAT." - (cl-case cat - (file (all-the-icons-completion-get-file-icon cand)) - (project-file (all-the-icons-completion-get-file-icon cand)) - (buffer (all-the-icons-completion-get-buffer-icon cand)) - (project-buffer (all-the-icons-completion-get-buffer-icon cand)) - (t "")))) + ;; Override default category lookup function to add support for + ;; project-buffer and project-file. + (defun all-the-icons-completion-get-icon (cand cat) + "Return the icon for the candidate CAND of completion category CAT." + (cl-case cat + (file (all-the-icons-completion-get-file-icon cand)) + (project-file (all-the-icons-completion-get-file-icon cand)) + (buffer (all-the-icons-completion-get-buffer-icon cand)) + (project-buffer (all-the-icons-completion-get-buffer-icon cand)) + (t "")))) ;; Using MintSoup's fork of all-the-icons-completion. (when (not (fboundp 'all-the-icons-completion-get-file-icon)) @@ -50,6 +64,11 @@ (cl-defmethod all-the-icons-completion-get-icon ((cand string) (cat (eql 'project-buffer))) (all-the-icons-completion-get-icon cand 'buffer)))) +;; (defun siren-all-icons-complete-wrap (orig-fun &rest args) +;; "Wrap `all-the-icons-completion' to use `siren-all-icons-complete' instead." +;; (message "args: %s" args) +;; (apply orig-fun args)) +;; (advice-add 'all-the-icons-completion-get-icon :around #'siren-all-icons-complete-wrap) (provide 'siren-all-the-icons) ;;; siren-all-the-icons.el ends here diff --git a/modules/editor/siren-nerd-icons.el b/modules/editor/siren-nerd-icons.el new file mode 100644 index 0000000..9b56092 --- /dev/null +++ b/modules/editor/siren-nerd-icons.el @@ -0,0 +1,51 @@ +;;; siren-nerd-icons.el --- jimeh's Emacs Siren: nerd-icons configuration. + +;;; Commentary: + +;; Basic configuration for nerd-icons. + +;;; Code: + +(use-package nerd-icons + :if (not window-system) + :config + (if (and window-system + (member "Menlo Nerd Font" (font-family-list))) + (setq nerd-nerd-icons-font-family "Menlo Nerd Font"))) + +(use-package nerd-icons-completion + :straight (nerd-icons-completion :type git :host github + :repo "rainstormstudio/nerd-icons-completion") + :after nerd-icons + :if (not window-system) + :demand t + :hook + (marginalia-mode . nerd-icons-completion-marginalia-setup) + + :config + (nerd-icons-completion-mode)) + +(use-package nerd-icons-dired + :straight (nerd-icons-dired :type git :host github + :repo "rainstormstudio/nerd-icons-dired") + :after nerd-icons + :if (not window-system) + :hook + (dired-mode . nerd-icons-dired-mode)) + +(use-package nerd-icons-ibuffer + :after nerd-icons + :if (not window-system) + :hook + (ibuffer-mode . nerd-icons-ibuffer-mode)) + +(use-package treemacs-nerd-icons + :straight (treemacs-nerd-icons + :type git :host github :repo "rainstormstudio/treemacs-nerd-icons") + :after (nerd-icons treemacs) + :if (not window-system) + :config + (treemacs-load-theme "nerd-icons")) + +(provide 'siren-nerd-icons) +;;; siren-nerd-icons.el ends here diff --git a/modules/projects/siren-treemacs.el b/modules/projects/siren-treemacs.el index 1f3f530..743b7a0 100644 --- a/modules/projects/siren-treemacs.el +++ b/modules/projects/siren-treemacs.el @@ -61,9 +61,6 @@ (treemacs-define-RET-action 'file-node-closed #'treemacs-visit-node-in-most-recently-used-window)) -(use-package treemacs-all-the-icons - :after (treemacs)) - (use-package treemacs-projectile :after (treemacs projectile) :custom diff --git a/modules/themes/siren-doom-themes.el b/modules/themes/siren-doom-themes.el index 9b1b7d5..3e505ef 100644 --- a/modules/themes/siren-doom-themes.el +++ b/modules/themes/siren-doom-themes.el @@ -8,6 +8,7 @@ (require 'siren-all-the-icons) (require 'siren-doom-modeline) +(require 'siren-nerd-icons) (use-package doom-themes :custom