From 6f5077f32731515ed7168e848f9e4bd931359e94 Mon Sep 17 00:00:00 2001 From: jdreichmann Date: Wed, 29 May 2019 19:49:29 +0200 Subject: [PATCH] tmux: Add controller configuration into auto-generation aswell --- roles/tmux/tasks/main.yml | 6 +++ roles/tmux/templates/controller.tmux.conf.j2 | 39 ++++++++++++++++ roles/tmux/templates/tmux.conf.j2 | 48 ++++++++++---------- 3 files changed, 69 insertions(+), 24 deletions(-) create mode 100644 roles/tmux/templates/controller.tmux.conf.j2 diff --git a/roles/tmux/tasks/main.yml b/roles/tmux/tasks/main.yml index 0091816..1d75f9b 100644 --- a/roles/tmux/tasks/main.yml +++ b/roles/tmux/tasks/main.yml @@ -4,9 +4,15 @@ package: name: tmux state: present + ignore_errors: true - name: Template config file into home folder template: src: tmux.conf.j2 dest: ~/.tmux.conf +- name: Template controller config file to home folder + template: + src: controller.tmux.conf.j2 + dest: ~/.controller.tmux.conf + diff --git a/roles/tmux/templates/controller.tmux.conf.j2 b/roles/tmux/templates/controller.tmux.conf.j2 new file mode 100644 index 0000000..6bbc3a3 --- /dev/null +++ b/roles/tmux/templates/controller.tmux.conf.j2 @@ -0,0 +1,39 @@ +# Reload controller config with "r" key +unbind t +bind t source-file ~/.controller.tmux.conf \; display-message "Controller config reloaded..." + +# No automatic renaming of windows +set -g automatic-rename off + +# Enable 256-color terminal +set -g default-terminal "screen-256color" + +# Set titles to be informative +set set-titles on +set set-titles-string "tmux: [#H] [#S] [#W:#D #I:#P]" + +# Change colors on the pane seperators +set pane-border-fg colour237 +set pane-active-border-fg colour27 + +# Tweak currently highlighted window ('active') +setw window-status-current-fg colour236 +setw window-status-current-bg colour27 +setw window-status-current-format " #F[#W] " +setw window-status-current-attr none + +# Tweak overview of windows +setw window-status-format " #F[#I][#W] " +setw window-status-bg colour237 +setw window-status-fg colour255 + +# Tweak status line design +set status-bg colour237 +set status-fg colour27 +set status-justify centre +set status-left " [#H] [#S] " +set status-left-length 100 +set status-right ' [#(curl https://wttr.in/berlin?format=3)] [%Y-%m-%d %H:%M.%S] ' +# Refresh status bar every second +set status-interval 1 + diff --git a/roles/tmux/templates/tmux.conf.j2 b/roles/tmux/templates/tmux.conf.j2 index 0c3af9e..791afa3 100644 --- a/roles/tmux/templates/tmux.conf.j2 +++ b/roles/tmux/templates/tmux.conf.j2 @@ -2,39 +2,39 @@ bind r source-file ~/.tmux.conf \; display-message "Config reloaded..." # No automatic renaming of windows -set -g automatic-rename off +set automatic-rename off # Enable 256-color terminal -set -g default-terminal "screen-256color" +set default-terminal "screen-256color" # Set titles to be informative -set -g set-titles on -set -g set-titles-string "tmux: [#H] [#S] [#W:#D #I:#P]" +set set-titles on +set set-titles-string "tmux: [#H] [#S] [#W:#D #I:#P]" -# Install tmux-plugin-manager, first run `git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm` -#set -g @plugin 'tmux-plugins/tpm' -#set -g @plugin 'tmux-plugins/tmux-sensible' +# Change pane colors +set pane-border-fg colour237 +set pane-active-border-fg colour199 -# Tweak currently highlighted pane -setw -g window-status-current-fg colour236 -setw -g window-status-current-bg colour199 -setw -g window-status-current-format " #F[#W] " -setw -g window-status-current-attr none +# Tweak currently active window +setw window-status-current-fg colour236 +setw window-status-current-bg colour199 +setw window-status-current-format " #F[#W] " +setw window-status-current-attr none -# Tweak pane display -setw -g window-status-format " #F[#W][#I] " -setw -g window-status-bg colour237 -setw -g window-status-fg colour255 +# Tweak display of window overview +setw window-status-format " #F[#W][#I] " +setw window-status-bg colour237 +setw window-status-fg colour255 # Tweak status line design -set -g status-bg colour235 -set -g status-fg colour199 -set -g status-justify centre -set -g status-left " [#H] [#S] " -set -g status-left-length 100 -set -g status-right '[FFKA: #(ip addr show freifunk | grep inet6 | grep -v fe80 | cut -d/ -f1 | cut -d " " -f6)] [%Y-%m-%d %H:%M.%S]' -# Refresh status bar every 5s -set -g status-interval 5 +set status-bg colour235 +set status-fg colour199 +set status-justify centre +set status-left " [#H] [#S] " +set status-left-length 100 +set status-right '[FFKA: #(ip addr show freifunk | grep inet6 | grep -v fe80 | cut -d/ -f1 | cut -d " " -f6)] [%Y-%m-%d %H:%M.%S]' +# Refresh status bar every 2s +set status-interval 2 # Initialize tmux-plugin-manager run '~/.tmux/plugins/tpm/tpm'