From f5a2e7c4fe559bdddf2cbfd3847f0058923b90be Mon Sep 17 00:00:00 2001 From: Craig Moore Date: Tue, 29 May 2018 23:42:45 -0400 Subject: [PATCH] Put steps into an install script. --- Linux-instructions.md | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/Linux-instructions.md b/Linux-instructions.md index e379a00..550aa08 100644 --- a/Linux-instructions.md +++ b/Linux-instructions.md @@ -17,19 +17,33 @@ emerge -av media-fonts/fira-code ## Manual Installation -With most desktop-oriented distributions, double-clicking each font file in the ttf folder and selecting “Install font” should be enough. If it isn’t, try this: +With most desktop-oriented distributions, double-clicking each font file in the ttf folder and selecting “Install font” should be enough. If it isn’t, create and run download_and_install.sh script: + +```bash +#!/bin/bash + +fonts_dir="~/.local/share/fonts" +if [ ! -d ${fonts_dir} ]; then + echo "mkdir -p $fonts_dir" + mkdir -p ${fonts_dir} +else + echo "Found fonts dir $fonts_dir" +fi + +for type in Bold Light Medium Regular Retina; do + file_path="~/.local/share/fonts/FiraCode-${type}.ttf" + file_url="https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-${type}.ttf?raw=true" + if [ ! -e ${file_path} ]; then + echo "wget -O $file_path $file_url" + wget -O ${file_path} ${file_url} + else + echo "Found existing file $file_path" + fi; +done + +echo "fc-cache -f" +fc-cache -f +``` -1. `mkdir -p ~/.local/share/fonts` -2. `touch download.sh` - -3. ```shell - # In download.sh - for type in Bold Light Medium Regular Retina; do - wget -O ~/.local/share/fonts/FiraCode-${type}.ttf \ - "https://github.com/tonsky/FiraCode/blob/master/distr/ttf/FiraCode-${type}.ttf?raw=true"; - done - ``` -4. `bash download.sh` -5. `fc-cache -f` [More details](https://github.com/tonsky/FiraCode/issues/4) \ No newline at end of file