#!/usr/bin/perl -s our ($c,$make,$h); use File::Copy; use strict; my $basedir = "$ENV{HOME}/.config/vmpk.sourceforge.net"; my @confs = ( 'VMPK-Virtual MIDI Piano Keyboard.conf', 'Virtual MIDI Piano Keyboard.conf' ) ; my $conf = 'VMPK-Virtual MIDI Piano Keyboard.conf'; for(@confs){ $conf = $_ if -f "$basedir/$_"; } unless($conf){ die("Unrecognise configuration for vmpk; please run if one first time\n"); } mkdir("$basedir/conf") unless -d "$basedir/conf"; if($make){ copy("$basedir/$conf","$basedir/conf/$make.conf"); exit 0 } if($h){ warn("Todo.\n"); #usage(); exit 0 } my $pat = shift or (usage() and die); for(<$basedir/conf/*>){ s!^$basedir/conf/!!; (copy("$basedir/conf/$_","$basedir/$conf") and last) if /$pat/; } system "vmpk"; __END__ =encoding utf8 =head1 NAME cvmpk - configurable vmpk "piano" keyboard =head1 SYNOPSIS cmvpk flute - load a configuration named "flute" cmvpk -c=2 conf2 cmvpk -make flute - copy the current config to ~/.conf with name "flute" cmvpk -h - list current configuration names =head1 DESCRIPTION =head2 EXPORT J.Joao Almeida, jj@di.uminho.pt =head1 SEE ALSO perl(1). =cut