File: xinstallvgafont.sh

package info (click to toggle)
dosemu 1.4.0%2Bsvn.1999-2
  • links: PTS
  • area: contrib
  • in suites: squeeze
  • size: 15,552 kB
  • ctags: 22,600
  • sloc: ansic: 136,915; asm: 4,107; sh: 1,606; perl: 1,411; makefile: 974; tcl: 599; awk: 404; yacc: 300; lex: 157
file content (40 lines) | stat: -rw-r--r-- 1,601 bytes parent folder | download | duplicates (11)
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
# This script installs the Xwindows VGA font. This should be run as root 
# if the Xwindows directories are writeable only by root.
#
# Please mail comments or improvements to Mark Rejhon at this Email address:
# ag115@freenet.carleton.ca

# Test for existence of X11
if ! [ -e $X11ROOTDIR/lib/X11 ]; then
	echo "This system doesn't have a $X11ROOTDIR/lib/X11 directory!"
	echo "Perhaps you don't have Xwindows installed?"

# Test for existence of vga.pcf in current directory
elif ! [ -r ./vga.pcf ]; then
	echo "Where's the VGA font file, 'vga.pcf'?  It's not in the current directory!"
	echo "Please run this script in the DOSEMU source directory."

# Test the existence of $X11ROOTDIR/lib/X11/fonts/misc
elif ! [ -e $X11ROOTDIR/lib/X11/fonts/misc ]; then
	echo "There is no $X11ROOTDIR/lib/X11/fonts/misc directory to install the VGA font in!"

# Test for writeability of $X11ROOTDIR/lib/X11/fonts/misc
elif ! [ -w $X11ROOTDIR/lib/X11/fonts/misc ]; then
	echo "The $X11ROOTDIR/lib/X11/fonts/misc directory is not writeable by you!"
	echo "This script should be executed as root, to install the VGA font file."

# Else, go ahead and try to install the font.
else
	echo "Installing VGA font for Xwindows..."
	install -m 644 vga.pcf $X11ROOTDIR/lib/X11/fonts/misc/
	cd $X11ROOTDIR/lib/X11/fonts/misc
	echo "Recompiling font table with 'mkfontdir'..."
	mkfontdir
	if ! [ $? -eq 0 ]; then
		echo "ERROR: Could not execute 'mkfontdir'.  VGA font not installed."
	else
		echo ""
		echo "If you are in X now, you need to reset or restart X windows to recognize"
		echo "the newly added font file."
	fi
fi