summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2017-08-05 18:29:34 +0200
committerRasmus Steinke <rasi@xssn.at>2017-08-05 18:29:34 +0200
commit5dc8f9a11136f3fe2f8680109b4312f3d41c6b68 (patch)
tree76320d105d76fb039b66b751875f41be19df8679
parent51ce4f60ee4b9402ca3feebd756751113587b01c (diff)
downloadperl-app-clerk-5dc8f9a11136f3fe2f8680109b4312f3d41c6b68.tar.gz
perl-app-clerk-5dc8f9a11136f3fe2f8680109b4312f3d41c6b68.tar.xz
add tmux_config option
-rw-r--r--clerk.conf3
-rwxr-xr-xclerk.pl4
-rw-r--r--tmux.conf55
3 files changed, 59 insertions, 3 deletions
diff --git a/clerk.conf b/clerk.conf
index 51b3765..ffec2c6 100644
--- a/clerk.conf
+++ b/clerk.conf
@@ -2,8 +2,9 @@
# MPD_HOST will override this
mpd_host=tauron
-# define where clerk should save its cache files
+# define file paths
database=/home/carnager/.config/clerk/db_msgpack
+tmux_config=/home/carnager/.config/clerk/clerk.tmux
# backend to use, possible options: fzf and rofi
backend=fzf
diff --git a/clerk.pl b/clerk.pl
index 25c4894..7b0f5e6 100755
--- a/clerk.pl
+++ b/clerk.pl
@@ -22,7 +22,6 @@ use Net::MPD;
use autodie;
$ENV{TMUX_TMPDIR}='/tmp/clerk/tmux';
-my $tmux_config='/etc/clerk/tmux.conf';
make_path($ENV{TMUX_TMPDIR}) unless(-d $ENV{TMUX_TMPDIR});
my $config_file = $ENV{'HOME'} . "/.config/clerk/clerk.conf";
@@ -36,6 +35,7 @@ my $cfg = new Config::Simple(filename=>"$config_file");
my $general_cfg = $cfg->param(-block=>"General");
my $mpd_host = $general_cfg->{mpd_host};
+my $tmux_config = $general_cfg->{tmux_config};
my $db_file = $general_cfg->{database};
my $backend = $general_cfg->{backend};
my $chunksize = $general_cfg->{chunksize};
@@ -204,7 +204,7 @@ sub formated_albums {
my %uniq_albums;
for my $i (@$rdb) {
- my $newkey = join "", map { lc } $i->@{qw/AlbumArtist Album Date/};
+ my $newkey = join "", $i->@{qw/AlbumArtist Album Date/};
if (!exists $uniq_albums{$newkey}) {
my $dir = (dirname($i->{uri}) =~ s/\/CD.*$//r);
$uniq_albums{$newkey} = {$i->%{qw/AlbumArtist Album Date mtime/}, Dir => $dir};
diff --git a/tmux.conf b/tmux.conf
new file mode 100644
index 0000000..6469cb8
--- /dev/null
+++ b/tmux.conf
@@ -0,0 +1,55 @@
+# Status bar
+set-option -g status-position top
+set -g status-interval 30
+set -g status-justify centre
+set -g status-left-length 40
+set -g status-left ''
+set -g status-right ''
+
+
+# Colors
+set -g status-bg colour235
+set -g status-fg default
+setw -g window-status-current-bg default
+setw -g window-status-current-fg default
+setw -g window-status-current-attr dim
+setw -g window-status-bg default
+setw -g window-status-fg white
+setw -g window-status-attr bright
+setw -g window-status-format ' #[fg=colour243,bold]#W '
+setw -g window-status-current-format ' #[fg=yellow,bold]#[bg=colour235]#W '
+
+# !Dont remove this keybinding header! (used to generate help)
+## Key Bindings
+bind-key -n F1 findw albums
+bind-key -n F2 findw tracks
+bind-key -n F3 findw latest
+bind-key -n F4 findw playlists
+bind-key -n F8 findw lyrics
+bind-key -n F5 findw queue
+bind-key -n C-F5 run-shell 'mpc prev --quiet'
+bind-key -n C-F6 run-shell 'mpc toggle --quiet'
+bind-key -n C-F7 run-shell 'mpc stop > /dev/null'
+bind-key -n C-F8 run-shell 'mpc next --quiet'
+bind-key -n C-F12 run-shell 'forceupdate="true" clerk_fzf --update'
+bind-key -n F12 run-shell 'clerk_fzf --update'
+bind-key -n F9 run-shell 'clerk_fzf --random_album'
+bind-key -n F10 run-shell 'clerk_fzf --random_tracks'
+bind-key -n C-h run-shell 'clerk_fzf --help'
+bind-key -n C-q kill-session -t music
+
+
+# tmux options
+set -g set-titles on
+set -g set-titles-string '#T'
+set -g default-terminal "screen-256color"
+setw -g mode-keys vi
+set -sg escape-time 1
+set -g repeat-time 1000
+set -g base-index 1
+setw -g pane-base-index 1
+set -g renumber-windows on
+unbind C-b
+set -g prefix C-a
+unbind C-p
+bind C-p paste-buffer