-
Notifications
You must be signed in to change notification settings - Fork 75
/
Copy pathinstall.sh
executable file
·48 lines (41 loc) · 1.35 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
#https://github.com/13rac1/twemoji-color-font
echo -e "Twitter Color Emoji font installer for Linux\n"
# Check for Bitstream Vera
fc-list | grep "Bitstream Vera" > /dev/null
RETURN=$?
if [ $RETURN -ne 0 ];then
echo "Bitstream Vera font family not found. Please install it:"
echo "sudo apt-get install ttf-bitstream-vera"
exit 1
fi
echo "NOTE: Changing default font family to Bitstream Vera"
# Stop on errors
set -e
# Set XDG_DATA_HOME to default if empty.
if [ -z "$XDG_DATA_HOME" ];then
XDG_DATA_HOME=$HOME/.local/share
fi
# Remove font from old directory if exists (temporary backwards compat)
if [ -f $HOME/.fonts/TwitterColorEmoji-SVGinOT.ttf ];then
echo "Removing the font from $HOME/.fonts"
rm $HOME/.fonts/TwitterColorEmoji-SVGinOT.ttf
fi
# Create a user font directory
mkdir -p $XDG_DATA_HOME/fonts
echo "Installing the font in: $XDG_DATA_HOME/fonts/"
cp TwitterColorEmoji-SVGinOT.ttf $XDG_DATA_HOME/fonts/
# Create a font config directory
FONTCONFIG=$HOME/.config/fontconfig
mkdir -p $FONTCONFIG/conf.d/
# Check for an existing font config
if [ -f $FONTCONFIG/fonts.conf ];then
# (temporary backwards compat)
echo "Existing fonts.conf backed up to fonts.bak"
cp $FONTCONFIG/fonts.conf $FONTCONFIG/fonts.bak
fi
# Install fonts.conf
cp fontconfig/46-twemoji-color.conf $FONTCONFIG/conf.d/
echo "Clearing font cache"
fc-cache -f
echo "Done!"