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

Fix fc-list error incurred while running install.sh #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,24 @@ set -xe

DATA="${XDG_DATA_HOME:-${HOME}/.local/share}/icons-in-terminal/"

mkdir -p ~/.fonts
cp ./build/icons-in-terminal.ttf ~/.fonts/
FONT_DIR=~/.local/share/fonts
mkdir -p $FONT_DIR
cp ./build/icons-in-terminal.ttf $FONT_DIR
mkdir -p ~/.config/fontconfig/conf.d
./scripts/generate_fontconfig.sh > ~/.config/fontconfig/conf.d/30-icons.conf
fc-cache -fvr --really-force ~/.fonts
# Make temporary file first to prevent incomplete conf file from being used by
# fc-list inside generate_fontconfig.sh. cf) fontconfig loads conf.d/[0-9]*
TMP_CONF_FILE=~/.config/fontconfig/conf.d/tmp-30-icons.conf
CONF_FILE=~/.config/fontconfig/conf.d/30-icons.conf
./scripts/generate_fontconfig.sh > $TMP_CONF_FILE
mv $TMP_CONF_FILE $CONF_FILE
fc-cache -fvr --really-force $FONT_DIR

mkdir -p "$DATA"
cp ./build/* "$DATA"

set +xe

echo -e "\n${YELLOW}Recommended additional step:"
echo "Edit ~/.config/fontconfig/conf.d/30-icons.conf"
echo "Edit $CONF_FILE"
echo "Check that the font(s) you are using in your terminal(s) is listed and remove all the others lines"
echo -e "\n${NORMAL}Font successfully installed. Now start a new terminal and run print_icons.sh :)"