summaryrefslogtreecommitdiffstats
path: root/perl-install/share/keymaps_generate
blob: a2c461fb6470f7221bd027286a7200a58775b4ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl

use lib "..";
use keyboard;

my $dir = "keymaps/usr/share/keymaps";
system("rm -rf keymaps ; mkdir -p keymaps/usr/share/keymaps");

foreach (keyboard::xmodmaps()) {
    my $kmap = keyboard::keyboard2kmap($_);
    if (system("./kmap2bkmap $kmap > $dir/$kmap.bkmap 2>/dev/null") != 0) {
	warn "unknown kmap $kmap\n";
	unlink "$dir/$kmap.bkmap";
    }
}

system("tar cfI keymaps.tar.bz2 -C keymaps usr") == 0 or die;
system("rm -rf keymaps");