From eba4dabb910ac645ede4f81d9b156056c5407a16 Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Thu, 3 Oct 2024 22:02:25 +0200 Subject: [PATCH] Add autoinstall firacode font --- config.el | 3 +++ install.sh | 29 ++++++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/config.el b/config.el index 9746b74..5cbbbc4 100644 --- a/config.el +++ b/config.el @@ -23,6 +23,9 @@ ;; ;;(setq doom-font (font-spec :family "Fira Code" :size 12 :weight 'semi-light) ;; doom-variable-pitch-font (font-spec :family "Fira Sans" :size 13)) + +(setq doom-font (font-spec :family "FiraCode Nerd Font" :size 12 :weight 'semi-light)) + ;; ;; If you or Emacs can't find your font, use 'M-x describe-font' to look them ;; up, `M-x eval-region' to execute elisp code, and 'M-x doom/reload-font' to diff --git a/install.sh b/install.sh index 3e26df9..11f6a66 100755 --- a/install.sh +++ b/install.sh @@ -33,7 +33,7 @@ prepare_doom() { prepare_custom_conf() { if [ ! -d ~/.config/doom ] then - git clone https://gitea.mrdev023.fr/florian.richer/emacs_conf ~/.config/doom + git clone git@gitea.mrdev023.fr:florian.richer/emacs_conf.git ~/.config/doom check_cmd "INSTALL CUSTOM CONF" else git -C ~/.config/doom pull origin main @@ -41,9 +41,31 @@ prepare_custom_conf() { fi } +prepare_fira_code_nerd_font() { + if [ -d ~/.local/share/fonts/fira_code ] + then + rm -rf ~/.local/share/fonts/fira_code + check_cmd "REMOVE OLD FIRA CODE INSTALLATION" + fi + + curl -L -o ~/fira_code.tar.xz https://github.com/ryanoasis/nerd-fonts/releases/download/v3.2.1/FiraCode.tar.xz + check_cmd "DOWNLOAD FIRA CODE NERD FONT" + + mkdir -p ~/.local/share/fonts/fira_code + check_cmd "PREPARE FIRA CODE NERD FONT INSTALLATION" + + tar -xvf ~/fira_code.tar.xz -C ~/.local/share/fonts/fira_code + check_cmd "INSTALL FIRA CODE NERD FONT" + + fc-cache -f -v + check_cmd "UPDATE FONT CACHE" + + rm -rf ~/fira_code.tar.xz + check_cmd "REMOVE USELESS FIRA CODE NERD FONT FILES" +} install_required_packages() { - sudo dnf install ripgrep fish -y + sudo dnf install ripgrep fish fd-find git -y } sync_doom() { @@ -58,7 +80,8 @@ sync_doom() { ### PROGRAMME ### ################# +install_required_packages +prepare_fira_code_nerd_font prepare_doom prepare_custom_conf -install_required_packages sync_doom