Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with getting all-the-icons-applied #194

Closed
gabriel4649 opened this issue Sep 27, 2016 · 3 comments
Closed

Problem with getting all-the-icons-applied #194

gabriel4649 opened this issue Sep 27, 2016 · 3 comments

Comments

@gabriel4649
Copy link

If I run (setq neo-theme (if window-system 'icons 'arrow)) using eval-region I can see the all-the-icons theme being applied. But if I run it from my init file it never gets applied.

@gabriel4649
Copy link
Author

The problem was that since I am using emacsclient, it defaults to arrow when emacs --daemon is run. Any alternative to (setq neo-theme (if window-system 'icons 'arrow)) for emacs --daemon users?

@aborn
Copy link
Collaborator

aborn commented Oct 12, 2016

The variable window-system's value is nil when run emacs as daemon mode. And the icons theme only supported in GUI emacs.

nixmaniack added a commit to nixmaniack/emacs-neotree that referenced this issue Nov 17, 2016
This helps when you start emacs with `--daemon` and use GUI and tty
simultaneously. Fix jaypei#194

* Use `display-graphic-p` instead of `window-system` which is deprecated for
  predicate use

The only caveat is if you open neotree in GUI and switch to same window in
terminal you won't get icons. Workaround is to toggle `neotree` in tty to switch
back to `+-` default theme.
@ykyuen
Copy link

ykyuen commented May 19, 2020

I got the same problem which all-the-icons doesn't show up in the neotree when running emacs in client/server mode.

The workaround is setting the neo-theme in after-make-frame-functions hook instead of the use-package config.

;; all-the-icons
;; https://github.com/domtronn/all-the-icons.el
(use-package all-the-icons
  :ensure t)

;; A workaround for missing all-the-icons in neotree when starting emacs in client mode
;; Ref:
;;   - https://github.com/jaypei/emacs-neotree/issues/194
;;   - https://emacs.stackexchange.com/questions/24609/determine-graphical-display-on-startup-for-emacs-server-client
(defun new-frame-setup (frame)
  (if (display-graphic-p frame)
      (setq neo-theme 'icons)))
;; Run for already-existing frames (For single instance emacs)
(mapc 'new-frame-setup (frame-list))
;; Run when a new frame is created (For emacs in client/server mode)
(add-hook 'after-make-frame-functions 'new-frame-setup)

Hope this help. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants