summaryrefslogtreecommitdiff
path: root/setfontdirs
blob: fa7b969a80168ac095cfedb0facb96727aa433fd (plain)
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
#!/bin/sh
#
# $XFree86: xc/lib/fontconfig/setfontdirs,v 1.4 2002/08/01 16:17:33 keithp Exp $
#
LANG=C
export LANG
FONTDIRS=fontdirs$$
trap "rm $FONTDIRS" 0
sh ./findfonts ${1+"$@"} > $FONTDIRS
cp fonts.conf.in fonts.conf
chmod +w fonts.conf
EDITOR=ed
(echo q | ed) > /dev/null 2>&1
if [ $? -ne 0 ]; then
	EDITOR=ex
	(echo q | ex) > /dev/null 2>&1
	if [ $? -ne 0 ]; then
		echo "$0: *** Error: Cannot find 'ed' or 'ex' editor"
		exit 1
	fi
fi
$EDITOR fonts.conf << EOF
/FONTPATH_END/a
<!-- Font directory list configured on `date` -->
.
+r $FONTDIRS
a
	<dir>~/.fonts</dir>

.
/FONTPATH_START/,/FONTPATH_END/d

w
q
EOF