mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-02-03 20:57:16 +08:00
Fix stuff
This commit is contained in:
parent
0117d5b113
commit
6962013a57
@ -1,5 +0,0 @@
|
||||
Section "InputClass"
|
||||
Identifier "Keyboard Defaults"
|
||||
MatchIsKeyboard "yes"
|
||||
Option "XkbLayout" "us"
|
||||
EndSection
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user