muxsa-al2fc honors ~/.muxsarc
This commit is contained in:
parent
6d01dec307
commit
7bf2082b2b
@ -1,6 +1,7 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl -w
|
||||||
use warnings;
|
use warnings;
|
||||||
use strict;
|
use strict;
|
||||||
|
use File::Slurp;
|
||||||
|
|
||||||
# muxsa-al2fc
|
# muxsa-al2fc
|
||||||
#
|
#
|
||||||
@ -35,10 +36,21 @@ use strict;
|
|||||||
# OTHER DEALINGS IN THE SOFTWARE.
|
# OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
############################################################################
|
############################################################################
|
||||||
|
# get MUXSA_KVM2PNG_SLIDE_PREFIX from ~/.muxsarc, environment var overrides
|
||||||
|
|
||||||
|
my %muxsarc;
|
||||||
|
if( -r (my $rc=$ENV{"HOME"}.'/.muxsarc') ){
|
||||||
|
%muxsarc = read_file($rc) =~ /^(\w+)=(?:"|')?(.*?)(?:"|')?$/mg;
|
||||||
|
}
|
||||||
|
|
||||||
|
my $slide_prefix = $muxsarc{'MUXSA_KVM2PNG_SLIDE_PREFIX'}//"";
|
||||||
|
if( $ENV{'MUXSA_KVM2PNG_SLIDE_PREFIX'} ){
|
||||||
|
$slide_prefix = $ENV{'MUXSA_KVM2PNG_SLIDE_PREFIX'};
|
||||||
|
}
|
||||||
|
|
||||||
|
############################################################################
|
||||||
|
|
||||||
sub printf_file {
|
sub printf_file {
|
||||||
my $slide_prefix = $ENV{'MUXSA_KVM2PNG_SLIDE_PREFIX'}//"";
|
|
||||||
if( $_[0] =~ /^[0-9]+$/ ){
|
if( $_[0] =~ /^[0-9]+$/ ){
|
||||||
printf("file '%s%04i.png'\n", $slide_prefix, $_[0]);
|
printf("file '%s%04i.png'\n", $slide_prefix, $_[0]);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user