initial commit of file from CVS for e-smith-base on Thu 26 Oct 11:24:52 BST 2023
This commit is contained in:
38
root/etc/e-smith/db/configuration/migrate/05sysconfig
Normal file
38
root/etc/e-smith/db/configuration/migrate/05sysconfig
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
open F, "/etc/locale.conf";
|
||||
my ($line) = grep(/^LANG/, <F>);
|
||||
close F;
|
||||
|
||||
my $lang = ($line =~ /^LANG="?([a-zA-Z0-9_.-]*)"?/) ? $1 : "en_US.UTF-8";
|
||||
|
||||
my $kbdtype = "pc";
|
||||
my $keytable = "us";
|
||||
|
||||
if (open F, "/etc/X11/xorg.conf.d/00-keyboard.conf")
|
||||
{
|
||||
my @lines = <F>;
|
||||
close F;
|
||||
|
||||
#($line) = grep(/^KEYBOARDTYPE/, @lines);
|
||||
#if ($line =~ /^KEYBOARDTYPE="(.*)"/)
|
||||
#{
|
||||
# $kbdtype = $1;
|
||||
#}
|
||||
|
||||
($line) = grep(/^\s+Option "XkbLayout"/, @lines);
|
||||
if ($line =~ /^\s+Option "XkbLayout"\s+"(.*)"/)
|
||||
{
|
||||
$keytable = $1;
|
||||
}
|
||||
}
|
||||
|
||||
my $sysconfig = $DB->get('sysconfig') ||
|
||||
$DB->new_record('sysconfig',
|
||||
{ type => 'configuration'}
|
||||
);
|
||||
$sysconfig->merge_props(
|
||||
Language => $lang,
|
||||
KeyboardType => $kbdtype,
|
||||
Keytable => $keytable,
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user