aboutsummaryrefslogtreecommitdiff
path: root/.emacs.d
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2020-04-20 22:33:48 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2020-04-20 22:33:48 +0200
commite7619e72c9aa98b9edfe99ad501eade808389f73 (patch)
treeb30863373ae4f5aa566c3d34020b7e639e44b9b0 /.emacs.d
parent481fb2622ddce937b0b4f56d936590093e7d5841 (diff)
downloaddotfiles-e7619e72c9aa98b9edfe99ad501eade808389f73.tar.gz
dotfiles-e7619e72c9aa98b9edfe99ad501eade808389f73.zip
emacs: make sure that all-the-icons is installed
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to '.emacs.d')
-rw-r--r--.emacs.d/init.org21
1 files changed, 21 insertions, 0 deletions
diff --git a/.emacs.d/init.org b/.emacs.d/init.org
index 35891e0..704dc39 100644
--- a/.emacs.d/init.org
+++ b/.emacs.d/init.org
@@ -204,8 +204,29 @@ Relative line numbers support is builtin since GNU Emacs 26.1:
Use the much fancier =doom-modeline= as our modeline:
#+BEGIN_SRC elisp
+(use-package all-the-icons
+ :ensure t
+ :config
+ (require 'cl-lib)
+
+ ;; Check if the fonts have been already been installed. If that is not the
+ ;; case, then install it now. The path detection is taken from
+ ;; all-the-icons.el.
+ (let* ((font-dest (cl-case window-system
+ (x (concat (or (getenv "XDG_DATA_HOME")
+ (concat (getenv "HOME") "/.local/share"))
+ "/fonts/"))
+ (mac (concat (getenv "HOME") "/Library/Fonts/" ))
+ (ns (concat (getenv "HOME") "/Library/Fonts/" ))))
+ (ttf-path (concat font-dest "all-the-icons.ttf")))
+
+ (unless (file-exists-p ttf-path)
+ (message "Installing fonts...")
+ (all-the-icons-install-fonts))))
+
(use-package doom-modeline
:ensure t
+ :after all-the-icons
:init
;; We are using the default values except for a couple of values, mainly
;; around icons.