summaryrefslogtreecommitdiffstats
path: root/setsysfont
blob: 29d4506cbf0bde323141540a0055f11af3e1c837 (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
37
38
39
40
41
#!/bin/sh

PATH=/bin:/usr/bin

if [ -f /etc/sysconfig/i18n ]; then
  . /etc/sysconfig/i18n
fi

case "$LANG" in
    *.utf8|*.UTF-8)
         if [ -x /bin/unicode_start ] && /sbin/consoletype fg ; then
      	    exec unicode_start $SYSFONT $SYSFONTACM
	 fi
	 ;;
    *)
	if /sbin/consoletype fg ; then
		# no exec, unicode_stop does not set a font
	        unicode_stop
	fi
	;;
esac

if [ -x /bin/setfont ]; then
  if [ -n "$UNIMAP" ]; then
    ARGS="-u $UNIMAP"
  fi
  if [ -n "$SYSFONTACM" ]; then
    if [ ! -f /lib/kbd/consoletrans/${SYSFONTACM}_to_uni.trans ]; then
        SYSFONTACM=`echo $SYSFONTACM | sed "s|iso0|8859-|g;s|iso|8859-|g"`
    fi
    ARGS="$ARGS -m $SYSFONTACM"
  fi
  if [ -n "$SYSFONT" ]; then
    /bin/setfont $SYSFONT $ARGS
#  else
#    /bin/setfont
    echo -ne "\033(K" 2>/dev/null > /proc/$$/fd/0
  fi
fi

exit 0