Skip to content
This repository has been archived by the owner on Nov 10, 2018. It is now read-only.

Commit

Permalink
linux: Update fontconfig install destination
Browse files Browse the repository at this point in the history
The provided font config was being installed at:
~/.config/fontconfig/fonts.conf
it is better to install at:
~/.config/fontconfig/conf.d/56-emojione-color.conf

Adds uninstall.sh

Fixes #29
  • Loading branch information
13rac1 committed Apr 15, 2016
1 parent cc38faa commit e215f27
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
11 changes: 6 additions & 5 deletions linux/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,26 @@ if [ -z "$XDG_DATA_HOME" ];then
fi

# Remove font from old directory if exists (temporary backwards compat)
if [ -f ~/.fonts/EmojiOneColor-SVGinOT.ttf ];then
echo "Removing the font from ~/.fonts"
rm ~/.fonts/EmojiOneColor-SVGinOT.ttf
if [ -f $HOME/.fonts/EmojiOneColor-SVGinOT.ttf ];then
echo "Removing the font from $HOME/.fonts"
rm $HOME/.fonts/EmojiOneColor-SVGinOT.ttf
fi

# Create a user font directory
mkdir -p $XDG_DATA_HOME/fonts
echo "Installing the font in: $XDG_DATA_HOME/fonts/"
cp EmojiOneColor-SVGinOT.ttf $XDG_DATA_HOME/fonts/

# Create a font config directory
FONTCONFIG=$HOME/.config/fontconfig
FONTCONFIG=$HOME/.config/fontconfig/conf.d
mkdir -p $FONTCONFIG
# Check for an existing font config
if [ -f $FONTCONFIG/fonts.conf ];then
echo "Existing fonts.conf backed up to fonts.bak"
cp $FONTCONFIG/fonts.conf $FONTCONFIG/fonts.bak
fi
# Install fonts.conf
cp fontconfig/user-bitstream-vera-fonts.conf $FONTCONFIG/fonts.conf
cp fontconfig/56-emojione-color.conf $FONTCONFIG/

echo "Clearing font cache"
fc-cache -f
Expand Down
21 changes: 21 additions & 0 deletions linux/uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
#https://github.com/eosrei/emojione-color-font
echo "Emoji One Color font uninstaller for Linux\n"

# Stop on errors
set -e
set -v

# Set XDG_DATA_HOME to default if empty.
if [ -z "$XDG_DATA_HOME" ];then
XDG_DATA_HOME=$HOME/.local/share
fi
FONTCONFIG=$HOME/.config/fontconfig/conf.d

rm -f $XDG_DATA_HOME/fonts/EmojiOneColor-SVGinOT.ttf
rm -f $FONTCONFIG/fontconfig/56-emojione-color.conf

echo "Clearing font cache"
fc-cache -f

echo "Done!"

0 comments on commit e215f27

Please sign in to comment.