summaryrefslogtreecommitdiff
path: root/configs/install-iso/default-config/usr/bin/km
blob: c8d4817fc0197017b230919aa26e3fcec6e5a378 (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
42
43
44
45
46
47
48
49
#!/bin/bash

ANSWER=$(mktemp)
BASEDIR="/usr/share/kbd"

domenu()
{
	menutype=$1 ; shift
	text=$1     ; shift
	height=$1   ; shift
	width=$1    ; shift
	mheight=$1  ; shift
	
	dialog --cancel-label "Skip" --$menutype "$text" $height $width $mheight $*
}

KEYMAPS=
for i in $(find $BASEDIR/keymaps -name "*.gz" | sort); do
	KEYMAPS="$KEYMAPS ${i##$BASEDIR/keymaps/} -"
done
domenu menu "Select A Keymap" 22 60 16 $KEYMAPS 2>$ANSWER
keymap=$(cat $ANSWER)

FONTS=
# skip .cp.gz and partialfonts files for now see bug #6112, #6111
for i in $(find $BASEDIR/consolefonts -maxdepth 1 ! -name '*.cp.gz' -name "*.gz"  | sed 's|^.*/||g' | sort); do
	FONTS="$FONTS $i -"
done
domenu menu "Select A Console Font" 22 60 16 $FONTS 2>$ANSWER
font=$(cat $ANSWER)

if [ "$keymap" ]; then
	loadkeys -q $BASEDIR/keymaps/$keymap
fi

if [ "$font" ]; then
	for i in $(seq 1 4); do
		if [ -d /dev/vc ]; then
			setfont $BASEDIR/consolefonts/$font -C /dev/vc/${i}
		else
			setfont $BASEDIR/consolefonts/$font -C /dev/tty${i}
		fi
	done
fi

rm -f $ANSWER
clear
exit 0