# --- Workstation Office Workstation [icon=office] [path=Workstation] [descr=Office programs: wordprocessors (kword, abiword), spreadsheets (kspread, gnumeric), pdf viewers, etc] OFFICE PUBLISHING PIM Game station [icon=arcade] [path=Workstation] [descr=Amusement programs: arcade, boards, strategy, etc] GAMES Multimedia station [icon=multimedia] [path=Workstation] [descr=Sound and video playing/editing programs] AUDIO VIDEO GRAPHICS Internet station [icon=networking] [path=Workstation] [descr=Set of tools to read and send mail and news (pine, mutt, tin..) and to browse the Web] NETWORKING_WWW NETWORKING_MAIL NETWORKING_NEWS COMMUNICATIONS NETWORKING_CHAT NETWORKING_FILE_TRANSFER NETWORKING_IRC NETWORKING_INSTANT_MESSAGING NETWORKING_DNS Network Computer (client) [icon=terminals] [path=Workstation] [descr=Clients for different protocols including ssh] NETWORKING_REMOTE_ACCESS NETWORKING_FILE Configuration [icon=configuration] [path=Workstation] [descr=Tools to ease the configuration of your computer] CONFIG WEBMIN Scientific Workstation [icon=sciences] [path=Workstation] [descr=] SCIENCES Console Tools [icon=terminals] [path=Workstation] [descr=Editors, shells, file tools, terminals] EDITORS TERMINALS TEXT_TOOLS SHELLS FILE_TOOLS # --- Graphical Environment KDE Workstation [icon=kde] [path=Graphical Environment] [descr=The K Desktop Environment, the basic graphical environment with a collection of accompanying tools] KDE X Gnome Workstation [icon=gnome] [path=Graphical Environment] [descr=A graphical environment with user-friendly set of applications and desktop tools] GNOME X Other Graphical Desktops [icon=windowmanager] [path=Graphical Environment] [descr=Icewm, Window Maker, Enlightenment, Fvwm, etc] GRAPHICAL_DESKTOP X # --- Development Development [icon=editors] [path=Development] [descr=C and C++ development libraries, programs and include files] DEVELOPMENT EDITORS Documentation [icon=documentation] [path=Development] [descr=Books and Howto's on Linux and Free Software] BOOKS LSB [icon=documentation] [path=Development] [descr=Linux Standard Base. Third party applications support] LSB # --- Server Web/FTP [icon=file_transfer] [path=Server] [descr=Apache, Pro-ftpd] NETWORKING_WWW_SERVER NETWORKING_FILE_TRANSFER_SERVER Mail/Groupware/News [icon=mail] [path=Server] [descr=Postfix mail server, Inn news server] NETWORKING_MAIL_SERVER NETWORKING_NEWS_SERVER Database [icon=archiving] [path=Server] [descr=PostgreSQL or MySQL database server] DATABASES DATABASES_SERVER Firewall/Router [icon=networking] [path=Server] [descr=Internet gateway] NETWORKING_FIREWALLING_SERVER DNS/NIS [icon=hardware] [path=Server] [descr=Domain Name and Network Information Server] NIS_SERVER NETWORKING_DNS_SERVER Network Computer server [icon=networking] [path=Server] [descr=NFS server, SMB server, Proxy server, ssh server] NETWORKING_FILE_SERVER NETWORKING_REMOTE_ACCESS_SERVER nux Mageia Installer and base platform for many utilitiesThierry Vignaud [tv]
summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/keyboarddrake
blob: 0ac98cb495936e46da220755a3ea53177f4e7e59 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/perl

use lib qw(/usr/lib/libDrakX);

use standalone;     #- warning, standalone must be loaded very first, for 'explanations'

use interactive;
use keyboard;
use Xconfigurator_consts;
use common;
use c;

$::isEmbedded = ($::XID, $::CCPID) = "@ARGV" =~ /--embedded (\w+) (\w+)/;
local $_ = join '', @ARGV;

/-h/ and die _("usage: keyboarddrake [--expert] [keyboard]\n");

$::expert = /-expert/;

print "[$::expert]\n";
my $keyboard='';
if ($::expert) { ($keyboard) = grep { !/^-/ } @ARGV;}
print "[$keyboard]\n";
my $in = 'interactive'->vnew('su', 'keyboard');

begin:
$::isEmbedded and kill USR2, $::CCPID;
$keyboard ||= $in->ask_from_listf_(_("Keyboard"),
				   _("Please, choose your keyboard layout."),
				   \&keyboard::keyboard2text,
				   [ keyboard::keyboards() ],
				   keyboard::read());
if ($keyboard) {
    keyboard::keyboard2text($keyboard) or die "bad keyboard $keyboard\n";

    my $isNotDelete = $::expert && !$in->ask_yesorno("BackSpace", _("Do you want the BackSpace to return Delete in console?"), 1);

    my $kmap = keyboard::keyboard2kmap($keyboard);
    system('loadkeys', $kmap);

    my $xkb = keyboard::keyboard2xkb($keyboard);
    system('setxkbmap', $xkb);

    my $f = "/etc/X11/XF86Config";
    my $g = "/etc/X11/XF86Config-4";

    substInFile {
	if (/^Section\s+"Keyboard"/ .. /^EndSection/) {
	    s|^(\s*XkbLayout\s+).*|$1"$xkb"| 
	      and $_ .= join '', map { "    $_\n" } @{$Xconfigurator::xkb_options{$xkb} || []};
	    $_ = '' if m,^(\s*(XkbVariant|XkbOptions)\s+),; # remove existing one
	}
    } $f if -e $f && !$::testing;

    substInFile {
	if (/Identifier\s+"Keyboard1"/ .. /^EndSection/) {
	    s|^(\s*Option\s+"XkbLayout"\s+).*|$1"$xkb"| 
	      and $_ .= join '', map { /(\S+)(.*)/; qq(    Option "$1" $2\n) } @{$Xconfigurator::xkb_options{$xkb} || []};
	    $_ = '' if m,^(\s*Option\s+"(XkbVariant|XkbOptions)"\s+),; # remove existing one
	}
    } $g if -e $g && !$::testing;

    keyboard::write('', $keyboard, $isNotDelete);
}

if ($::isEmbedded) {
    kill(USR1, $::CCPID);
    $keyboard = '';
    goto begin;
} else {
    $in->exit(0);
}