1

I recently setup all-the-icons with dired (all-the-icons-dired) and the appropriate icons do appear but they're all white for some reason. I tried reducing my ~/.emacs down to just the dired settings and still see the issue. I'm running a custom build of emacs 27.1 with GTK+ and I do see colors and graphics from various other packages just fine.

Oddly, I see the same exact issue on the brew version I have installed on MacOS. This leads me to believe I may not be configuring dired or all-the-icons correctly.

This is what I have in my ~/.emacs:

(use-package dired
  :ensure nil ;; Don't try to load pkg since it's built-in.
  :commands (dired dired-jump)
  :bind (("C-x C-j" . dired-jump))
  :custom ((dired-listing-switches "-lBgaGh --group-directories-first")
           (delete-by-moving-to-trash t))
  :config
  (use-package dired-single
    :config
    (define-key dired-mode-map [remap dired-find-file]
      'dired-single-buffer)
    (define-key dired-mode-map [remap dired-up-directory]
      'dired-single-up-directory))
  (use-package all-the-icons-dired
    :if (display-graphic-p)
    :hook (dired-mode . all-the-icons-dired-mode))
  (use-package dired-hide-dotfiles
    :hook (dired-mode . dired-hide-dotfiles-mode)
    :bind (:map dired-mode-map
                ("." . dired-hide-dotfiles-mode))))

enter image description here

3
  • Have you M-x all-the-icons-install-fonts Apr 9, 2022 at 8:06
  • I've also run into this same issue (looks like you might also be watching the system crafters videos ha). I tried C4ffeine Add1ct's suggestion but had already done that so it didn't fix it. It appears this is the same issue on reddit: reddit.com/r/emacs/comments/djcgov/… I tried adding the suggested font-lock+ package from that and it also didn't work. Will update here if I find a solution.
    – ice1080
    Apr 9, 2022 at 23:11
  • @C4ffeineAdd1ct If you haven't yet run that command then you won't see any icons at all.
    – foobrew
    Apr 16, 2022 at 20:16

1 Answer 1

2

The cause and solution turn out to be rather simple. There's a boolean var in the all-the-icons-dired package named all-the-icons-dired-monochrome which does exactly what it says and forces a monochromatic display of all icons. For reasons I can't imagine, this var is true by default. Simply set it to nil and the icons will be displayed in color, as expected.

Example:

(use-package dired
  ..other setup stuff here..
  :config
  (use-package all-the-icons-dired
    :if (display-graphic-p)
    :hook (dired-mode . all-the-icons-dired-mode)
    :config (setq all-the-icons-dired-monochrome nil)))

While troubleshooting this issue, I ended up discovering treemacs-icons-dired which is a much better solution for reasons pointed out in the post announcing it (aside from the fact that the icons look much nicer, IMHO).

Example config:

(use-package dired
  :config
  (use-package treemacs-icons-dired
    :if (display-graphic-p)
    :config (treemacs-icons-dired-mode)))

The treemacs-icons-dired package is available in MELPA and I don't think you need to have treemacs installed for it to work..but I could be wrong about that since I already had treemacs installed in my config.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.