-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-consolefont
60 lines (44 loc) · 2.13 KB
/
setup-consolefont
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
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/sh
if [ "$(id -u)" -ne 0 ] || [ "$DOAS_USER" = "root" ] || [ "$DOAS_USER" = "" ]; then
echo "run this script as a regular user using doas"
exit 1
fi
#########################################################################################
# PROGRAM METADATA
#########################################################################################
PROGRAM=$(basename "$0")
#########################################################################################
# PROGRAM DEPENDENCIES
#########################################################################################
. "/lib/libusralpine.sh"
#########################################################################################
# PROGRAM DATA
#########################################################################################
FONTPKG=terminus-font
FONT=ter-116b.psf.gz
#########################################################################################
# PROGRAM
#########################################################################################
header "$PROGRAM"
step "adding font"
apk add "$FONTPKG" || die "consolefont setup - failed to add $FONTPKG."
step "adding font configuration"
{ cat >/etc/conf.d/consolefont <<-__EOF__
# The consolefont service is not activated by default. If you need to
# use it, you should run "rc-update add consolefont boot" as root.
#
# consolefont specifies the default font that you'd like Linux to use on the
# console. You can find a good selection of fonts in /usr/share/consolefonts;
consolefont="default8x16.psf.gz"
# consoletranslation is the charset map file to use. Leave commented to use
# the default one. Have a look in /usr/share/consoletrans for a selection of
# map files you can use.
#consoletranslation="8859-1_to_uni.trans"
# alpine-user-conf: setup-consolefont
consolefont="$FONT"
__EOF__
} || die "consolefont setup - failed to add font configuration."
step "adding consolefont service to boot"
rc-update add consolefont boot || die "consolefont setup - failed to add consolefont service to boot."
step "setting font"
setfont "/usr/share/consolefonts/$FONT" || warn "consolefont setup - failed to set $FONT."