summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2018-02-25 06:52:35 +0100
committerRasmus Steinke <rasi@xssn.at>2018-02-25 06:52:35 +0100
commit572dbb334eb80f8fdcd0d45b6c02742137787cf3 (patch)
tree89dd0f39d58bc6cb0d56bb807b307209da8a5cc7
parent3a127e9fc34494d63c2dd174c43a5867d56846cc (diff)
downloadclerk-572dbb334eb80f8fdcd0d45b6c02742137787cf3.tar.gz
clerk-572dbb334eb80f8fdcd0d45b6c02742137787cf3.tar.bz2
Add possibility to override rofi theme and width #37
-rwxr-xr-xclerk.pl23
1 files changed, 22 insertions, 1 deletions
diff --git a/clerk.pl b/clerk.pl
index 4f242e8..02050de 100755
--- a/clerk.pl
+++ b/clerk.pl
@@ -125,6 +125,12 @@ 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 };
}
@@ -295,8 +301,19 @@ sub backend_call {
$fields //= "1,2,3,4,5";
my %backends = (
fzf => [ "fzf", "--reverse", "--no-sort", "-m", "-e", "--no-hscroll", "-i", "-d", "\t", "--tabstop=4", "+s", "--ansi", "--bind=esc:$random,alt-a:toggle-all,alt-n:deselect-all", "--with-nth=$fields" ],
- rofi => [ "rofi", "-matching", "regex", "-dmenu", "-kb-row-tab", "", "-kb-move-word-forward", "", "-kb-accept-alt", "Tab", "-multi-select", "-no-levensthein-sort", "-i", "-p", "> " ]
+ 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};
+ p $backends{rofi};
+ }
+
+ if ($rvar{rofi_theme} !~ /default/) {
+ push @{$backends{rofi}}, $rvar{rofi_theme}
+ }
+
my $handle = start $backends{$rvar{backend}} // die('backend not found'), \$input, \$out;
$input = join "", (@{$in});
finish $handle or die "No selection";
@@ -777,6 +794,10 @@ title_l=50
track_l=2
rating_l=4
+[Rofi]
+width=default
+theme=default
+
@@ clerk.tmux
# !Dont move this section.
## Key Bindings