File: list-keymaps.pl

package info (click to toggle)
console-data 2:1.12-5
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 6,388 kB
  • sloc: sh: 3,272; pascal: 472; makefile: 231; perl: 168
file content (31 lines) | stat: -rwxr-xr-x 863 bytes parent folder | download | duplicates (7)
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
#! /usr/bin/perl -w
use strict;
use vars qw($keymaps);

$keymaps = {};
require $ARGV[0];

my @output = ();
foreach my $kbdarch (keys %$keymaps) {
    next if $kbdarch eq 'default';
    my $kbdarchmaps = $keymaps->{$kbdarch};
    foreach my $family (keys %$kbdarchmaps) {
	next if $family eq 'default';
	my $familymaps = $kbdarchmaps->{$family};
	foreach my $layout (keys %$familymaps) {
	    next if $layout eq 'default';
	    my $layoutmaps = $familymaps->{$layout};
	    foreach my $kbdvariant (keys %$layoutmaps) {
		next if $kbdvariant eq 'default';
		my $kbdvariantmaps = $layoutmaps->{$kbdvariant};
		foreach my $mapvariant (keys %$kbdvariantmaps) {
		    next if $mapvariant eq 'default';
		    push @output, "$kbdarch $kbdvariantmaps->{$mapvariant}";
		}
	    }
	}
    }
}

my %output = map { $_ => 1 } @output;
print join("\n", sort keys %output), "\n";