Fix stuff

This commit is contained in:
Manuel 2013-02-05 22:32:14 +00:00
parent 0117d5b113
commit 6962013a57
3 changed files with 25 additions and 22 deletions

View File

@ -1,5 +0,0 @@
Section "InputClass"
Identifier "Keyboard Defaults"
MatchIsKeyboard "yes"
Option "XkbLayout" "us"
EndSection

View File

@ -5,23 +5,19 @@
pkgname=chakra-init-live
pkgver=2013.02
pkgrel=1
pkgrel=2
pkgdesc="Live-session systemd startup scripts"
arch=('x86_64')
url="http://www.chakra-project.org"
license=('GPL2')
source=('live' 'locale_setup.sh' '10-keyboard.conf')
source=('live' 'locale_setup.sh')
md5sums=('e757dbe814a219709d616c146a7c26a9'
'fedc492830e843c5067e5db7fb9338af'
'4df9f3c64316cf8b7f93729b389d704f')
'5c0d0898f7c1ab14adc0a4ade110fc0b')
package() {
cd ${srcdir}
# setup /etc
mkdir ${pkgdir}/etc
install -m755 -t ${pkgdir}/etc live
install -m755 -t ${pkgdir}/etc locale_setup.sh
mkdir ${pkgdir}/etc/skel
install -m755 -t ${pkgdir}/etc/skel 10-keyboard.conf
install -m755 -t ${pkgdir}/etc locale_setup.sh
}

View File

@ -21,33 +21,45 @@ get_country() {
}
get_keyboard() {
local KEYBOARD=$(get_bootparam_value keytable)
local KEYBOARD=$(get_bootparam_value keymap)
echo $KEYBOARD
}
get_layout {
local LAYOUT=$(get_bootparam_value layout)
echo $LAYOUT
}
# sets the locale as well the keymap
set_locale() {
# hack to be able to set the locale on bootup
local LOCALE=$(get_country)
local KEYMAP=$(get_keyboard)
local KEYMAP=$(get_keyboard)
local KBLAYOUT=$(get_layout)
# set a default value, in case something goes wrong, or a language doesn't have
# good defult settings
[ -n "$LOCALE" ] || LOCALE="en_US"
[ -n "$KEYMAP" ] || KEYMAP="us"
[ -n "$kBLAYOUT" ] || KBLAYOUT="us"
# comment out all locales which we don't need
sed -i "s/^/#/g" /etc/locale.gen
# copy the keyboard.conf file to it's place
cp -f /etc/skel/10-keyboard.conf /etc/X11/xorg.conf.d/10-keyboard.conf
sed -i "/XkbLayout/ s/us/"${KEYMAP}"/" /etc/X11/xorg.conf.d/10-keyboard.conf
echo "KEYMAP=\"${KEYMAP}\"" >> /etc/vconsole.conf
# Generate 10-keyboard.conf
mkdir -p /etc/X11/xorg.conf.d
echo "Section \"InputClass\"" >> /etc/X11/xorg.conf.d/10-keyboard.conf
echo " Identifier \"Keyboard Defaults\"" >> /etc/X11/xorg.conf.d/10-keyboard.conf
echo " MatchIsKeyboard \"yes\"" >> /etc/X11/xorg.conf.d/10-keyboard.conf
echo " Option \"XkbLayout\" \"${KBLAYOUT}\"" /etc/X11/xorg.conf.d/10-keyboard.conf
if [ "$KEYMAP" = "dvorak" ] ; then
echo " Option \"XkbVariant\" \"dvorak\"" >> /etc/X11/xorg.conf.d/10-keyboard.conf
fi
# set systemwide language
echo "LANG=${LOCALE}.UTF-8" > /etc/locale.conf
echo "LC_MESSAGES=${LOCALE}.UTF-8" >> /etc/locale.conf
# generate LOCALE
local TLANG=${LOCALE%.*} # remove everything after the ., including the dot from LOCALE
sed -i -r "s/#(.*${TLANG}.*UTF-8)/\1/g" /etc/locale.gen