summaryrefslogtreecommitdiff
path: root/configs/lxde-openrc/airootfs/root/.keymap.sh
blob: c6ed5fd78258987d5b3662b98027c02f2491094f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/bash

#Comprobe if X11 keymap was selected
code="$(grep XKBMAP= .codecheck | cut -d '=' -f 2)"
keymaps_list="$(sed -e '/! layout/,/^$/!d;/! layout/d;s/ /_/g;s/__/ /g;s/ _//' /usr/share/X11/xkb/rules/evdev.lst | sort)"

if [[ $code = "0" ]]; then
	keymap=$(zenity --list --title="Select your keymap" --column="Code Name" --column="Keymap" --hide-column=1 "$keymaps_list")
	setxkbmap "$keymap"

	#Save XKBMAP in .codecheck to use in other time. For example if you install X11 with scripts
	sed -i '/XKBMAP=./d' ~/.codecheck
	echo "XKBMAP=$keymap" >> ~/.codecheck
fi