Mercurial > hg > forks > geeqie
view keymap/keymap.pl @ 2878:8b1c451c8ff2
Additional remote commands
--get-filelist:[<FOLDER>] Get list of files and class
--get-filelist-recurse:[<FOLDER>] Get list of files and class recursive
--get-collection:<COLLECTION> Get collection content
--get-collection-list Get list of collections
Changed command:
--tell Print filename of current image [and Collection, if collection
being displayed]
author | Colin Clark <colin.clark@cclark.uk> |
---|---|
date | Fri, 04 Jan 2019 13:44:58 +0000 |
parents | 947ed00faccd |
children |
line wrap: on
line source
#!/usr/bin/perl use strict; my %funcs; open(ACCELS, "<$ENV{HOME}/.geeqie/accels") or die "No accel file"; while (<ACCELS>) { if (/gtk_accel_path "([^"]*)" *"([^"]*)"/) { my $name = $1; my $key = $2; $name =~ s/.*\///; $key =~ s/</</g; $key =~ s/>/>/g; $funcs{uc($key)} = $name; } } close(ACCELS); open(ACCELS, "<hardcoded_keys") or die "No hardcoded_keys file"; while (<ACCELS>) { if (/"([^"]*)" *"([^"]*)"/) { my $name = $1; my $key = $2; $name =~ s/.*\///; $key =~ s/</</g; $key =~ s/>/>/g; $funcs{uc($key)} = $name; } } close(ACCELS); open(IN, "<keymap_template.svg") or die "No svg file"; open(OUT, ">keymap.svg") or die "Can't write output file"; while (<IN>) { if (/>key:([^<]*)</) { my $key = uc($1); my $name = $funcs{$key}; s/>key:([^<]*)</>$name</; delete $funcs{$key}; } print OUT; } close(IN); close(OUT); for my $key (keys %funcs) { if ($key) { print STDERR "not found: '$key'\n"; } }