summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2018-02-25 13:27:15 +0100
committerRasmus Steinke <rasi@xssn.at>2018-02-25 13:27:15 +0100
commitcdbeca447b29feeb114d6726bcd01665910a32a2 (patch)
tree51cc232a2d1f6520534c0e8b4895d9162620e3f3
parent45ac705f6bbc3eeebb6ab6b9950fb305c03f0c17 (diff)
downloadclerk-cdbeca447b29feeb114d6726bcd01665910a32a2.tar.gz
clerk-cdbeca447b29feeb114d6726bcd01665910a32a2.tar.bz2
only add rofi options, if rofi interface was requested, clean up a little
-rwxr-xr-xclerk.pl22
1 files changed, 11 insertions, 11 deletions
diff --git a/clerk.pl b/clerk.pl
index 3aaf399..45318ed 100755
--- a/clerk.pl
+++ b/clerk.pl
@@ -104,6 +104,7 @@ sub parse_config {
my $g = $cfg->param(-block=>'General');
+ my $r = $cfg->param(-block=>'Rofi');
%rvar = (%rvar,
mpd_host => $g->{mpd_host},
songs => $g->{songs},
@@ -111,7 +112,9 @@ sub parse_config {
player => $g->{player},
tagging => $g->{tagging},
randomartist => $g->{randomartist},
- jump_queue => $g->{jump_queue}
+ jump_queue => $g->{jump_queue},
+ rofi_width => $r->{width},
+ rofi_theme => $r->{theme}
);
my $c = $cfg->param(-block=>'Columns');
@@ -125,10 +128,7 @@ sub parse_config {
albumartist => $c->{albumartist_l}
};
- my $r = $cfg->param(-block=>'Rofi');
%rvar = (%rvar,
- rofi_width => $r->{width},
- rofi_theme => $r->{theme}
);
$rvar{db} = { file => $rvar{db}, mtime => 0 };
@@ -304,14 +304,14 @@ sub backend_call {
rofi => [ "rofi", "-matching", "regex", "-dmenu", "-kb-row-tab", "", "-kb-move-word-forward", "", "-kb-accept-alt", "Tab", "-multi-select", "-no-levensthein-sort", "-i", "-p", "> " ]
);
- if ($rvar{rofi_width} !~ /default/) {
- push @{$backends{rofi}}, "-width";
- push @{$backends{rofi}}, $rvar{rofi_width};
- }
+ if ($rvar{backend} eq 'rofi') {
+ if ($rvar{rofi_width} ne 'default') {
+ push $backends{rofi}->@*, '-width', $rvar{rofi_width};
+ }
- if ($rvar{rofi_theme} !~ /default/) {
- push @{$backends{rofi}}, "-theme";
- push @{$backends{rofi}}, $rvar{rofi_theme}
+ if ($rvar{rofi_theme} ne 'default') {
+ push $backends{rofi}->@*, '-theme', $rvar{rofi_theme};
+ }
}
my $handle = start $backends{$rvar{backend}} // die('backend not found'), \$input, \$out;