summaryrefslogtreecommitdiff
path: root/chinese/cmexfonts/pkg-install
blob: ef6f5aeba68c8c6274ae85a184e9320b73d6e2b7 (plain) (blame)
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
#!/bin/sh
set -e

fontdir="/usr/X11R6/lib/X11/fonts/local"

# Add FontPath to /etc/X11/XF86Config

if [ -f /etc/X11/XF86Config ]
then
    if ! grep -q "^	*FontPath *[\"']$fontdir/" /etc/X11/XF86Config
    then
	echo "Adding FontPath \"$fontdir\" to /etc/X11/XF86Config ..."
	tmpfile="/tmp/tempfile"
	sed -e '/Section "Files"/,/EndSection/{
/EndSection/i\
	FontPath     \"'$fontdir'/:unscaled\"\
	FontPath     \"'$fontdir'/\"
}' /etc/X11/XF86Config >> $tmpfile
	mv -f $tmpfile /etc/X11/XF86Config
    else
	echo "Having FontPath \"$fontdir\" to /etc/X11/XF86Config ..."
    fi
else
    echo "/etc/X11/XF86Config not found!"
    echo "You need to add"
    echo "    FontPath   \"$fontdir/:unscaled\""
    echo "to /etc/X11/XF86Config yourself in order to use the font."
fi