/[soft]/drakx-kbd-mouse-x11/branches/1/tools/keyboarddrake
ViewVC logotype

Contents of /drakx-kbd-mouse-x11/branches/1/tools/keyboarddrake

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1651 - (show annotations) (download)
Thu Jun 2 20:51:14 2011 UTC (9 years ago) by dmorgan
File size: 2205 byte(s)
Branch for updates
1 #!/usr/bin/perl
2
3 use lib qw(/usr/lib/libDrakX);
4
5 # i18n: IMPORTANT: to get correct namespace (drakx-kbd-mouse-x11 instead of libDrakX)
6 BEGIN { unshift @::textdomains, 'drakx-kbd-mouse-x11' }
7
8 use standalone; #- warning, standalone must be loaded very first, for 'explanations'
9
10 use interactive;
11 use keyboard;
12 use Xconfig::xfree;
13 use common;
14 use any;
15 use c;
16
17 require_root_capability();
18 my $in;
19 my $keyboard = keyboard::read_or_default();
20 if (my ($kb) = grep { !/^-/ } @ARGV) {
21 keyboard::KEYBOARD2text($kb) or die "bad keyboard $kb\n";
22 $keyboard->{KEYBOARD} = $kb;
23 } elsif (grep { $_ eq '--migrate' } @ARGV) {
24 keyboard::write($keyboard);
25 exit 0;
26 } else {
27 $ugtk2::wm_icon = "/usr/share/mcc/themes/default/keyboard-mdk.png";
28 $in = 'interactive'->vnew('su');
29
30 my ($xkb_models, $model2text) = keyboard::xkb_models();
31 s/ /|/ foreach values %$model2text;
32 my $default_XkbModel = keyboard::default_XkbModel($keyboard);
33 $keyboard->{XkbModel} ||= $default_XkbModel;
34 my $is_default_XkbModel = $keyboard->{XkbModel} eq $default_XkbModel;
35
36 choose:
37 $in->ask_from(N("Keyboard"),
38 N("Please, choose your keyboard layout."),
39 [ { label => N("Keyboard layout"),
40 title => 1,
41 },
42 { val => \$keyboard->{KEYBOARD},
43 format => sub { translate(keyboard::KEYBOARD2text($_[0])) },
44 list => [ keyboard::KEYBOARDs() ],
45 type => 'list',
46 changed => sub {
47 if ($is_default_XkbModel) {
48 $keyboard->{XkbModel} = keyboard::default_XkbModel($keyboard);
49 }
50 },
51 },
52 { label => N("Keyboard type"),
53 title => 1,
54 },
55 { val => \$keyboard->{XkbModel},
56 format => sub { $model2text->{$_[0]} },
57 separator => '|',
58 changed => sub { $is_default_XkbModel = 0 },
59 list => $xkb_models },
60 ]) or goto end;
61
62 keyboard::group_toggle_choose($in, $keyboard) or goto choose;
63
64 if ($::expert) {
65 my $isNotDelete = !$in->ask_yesorno("BackSpace", N("Do you want the BackSpace to return Delete in console?"), 1);
66 $keyboard->{BACKSPACE} = $isNotDelete ? "BackSpace" : "Delete";
67 }
68 }
69
70
71 keyboard::configure_and_set_standalone($keyboard);
72
73 end:
74 $in->exit(0) if $in;

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.28