From e7619e72c9aa98b9edfe99ad501eade808389f73 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 20 Apr 2020 22:33:48 +0200 Subject: emacs: make sure that all-the-icons is installed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- .emacs.d/init.org | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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. -- cgit v1.2.3