diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-10-23 12:53:33 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-10-23 12:53:33 +0000 |
commit | a8e0062e543a5339aa8df1845a8204e8be5dcebc (patch) | |
tree | be06d87cbc40e66ecab5b0f20859f8ec1b16f94f /perl-install/keyboard.pm | |
parent | 477d8a32cbf3d9e4f383c0e6ac225d1ce117c9e3 (diff) | |
download | drakx-backup-do-not-use-a8e0062e543a5339aa8df1845a8204e8be5dcebc.tar drakx-backup-do-not-use-a8e0062e543a5339aa8df1845a8204e8be5dcebc.tar.gz drakx-backup-do-not-use-a8e0062e543a5339aa8df1845a8204e8be5dcebc.tar.bz2 drakx-backup-do-not-use-a8e0062e543a5339aa8df1845a8204e8be5dcebc.tar.xz drakx-backup-do-not-use-a8e0062e543a5339aa8df1845a8204e8be5dcebc.zip |
- use setxkbmap instead of xmodmap if setxkbmap is available
- don't run setxkbmap chrooted
Diffstat (limited to 'perl-install/keyboard.pm')
-rw-r--r-- | perl-install/keyboard.pm | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/perl-install/keyboard.pm b/perl-install/keyboard.pm index 4fdde31b7..ab448865f 100644 --- a/perl-install/keyboard.pm +++ b/perl-install/keyboard.pm @@ -450,8 +450,8 @@ sub xmodmap_file { sub setxkbmap { my ($keyboard) = @_; my $xkb = keyboard::keyboard2full_xkb($keyboard) or return; - run_program::rooted($::prefix, 'setxkbmap', '-option', '') if $xkb->{XkbOptions}; #- need re-initialised other toggles are cumulated - run_program::rooted($::prefix, 'setxkbmap', $xkb->{XkbLayout}, '-model' => $xkb->{XkbModel}, '-option' => $xkb->{XkbOptions} || '', '-compat' => $xkb->{XkbCompat} || ''); + run_program::run('setxkbmap', '-option', '') if $xkb->{XkbOptions}; #- need re-initialised other toggles are cumulated + run_program::run('setxkbmap', $xkb->{XkbLayout}, '-model' => $xkb->{XkbModel}, '-option' => $xkb->{XkbOptions} || '', '-compat' => $xkb->{XkbCompat} || ''); } sub setup { @@ -488,8 +488,12 @@ sub setup { c::_exit(0); } } - my $f = xmodmap_file($keyboard); - eval { run_program::run('xmodmap', $f) } if $f && !$::testing && $ENV{DISPLAY}; + if (-x "/usr/X11R6/bin/setxkbmap") { + setxkbmap($keyboard); + } else { + my $f = xmodmap_file($keyboard); + eval { run_program::run('xmodmap', $f) } if $f && !$::testing && $ENV{DISPLAY}; + } } sub write { |