[FIX] tmux.conf: support old tmux versions (fixes #9)

This commit is contained in:
Jannik Beyerstedt 2020-03-27 23:30:50 +01:00
parent 6750f1c370
commit 9183c3b0dc
2 changed files with 21 additions and 1 deletions

View File

@ -43,7 +43,6 @@
dest: "{{ item.dest }}" dest: "{{ item.dest }}"
with_items: with_items:
- { src: "{{ role_path }}/files/_gitignore_global", dest: ".gitignore_global" } - { src: "{{ role_path }}/files/_gitignore_global", dest: ".gitignore_global" }
- { src: "{{ role_path }}/files/_tmux.conf", dest: ".tmux.conf" }
- { src: "{{ role_path }}/files/_vimrc", dest: ".vimrc" } - { src: "{{ role_path }}/files/_vimrc", dest: ".vimrc" }
- { src: "{{ role_path }}/files/_oh-my-zsh/jtbx.zsh-theme", dest: ".oh-my-zsh/custom/themes/jtbx.zsh-theme" } - { src: "{{ role_path }}/files/_oh-my-zsh/jtbx.zsh-theme", dest: ".oh-my-zsh/custom/themes/jtbx.zsh-theme" }
- name: usersettings - Set zshrc - name: usersettings - Set zshrc
@ -55,6 +54,10 @@
src: "{{ role_path }}/templates/_gitconfig.j2" src: "{{ role_path }}/templates/_gitconfig.j2"
dest: "{{ ansible_user_dir }}/.gitconfig" dest: "{{ ansible_user_dir }}/.gitconfig"
when: usersetup_gitconfig == true when: usersetup_gitconfig == true
- name: usersettings - Set tmux.conf
template:
src: "{{ role_path }}/templates/_tmux.conf.j2"
dest: "{{ ansible_user_dir }}/.tmux.conf"
- name: usersettings - Create .vim directory - name: usersettings - Create .vim directory
file: file:

View File

@ -10,8 +10,10 @@ bind r source-file ~/.tmux.conf
# shorter timing # shorter timing
set -g repeat-time 200 set -g repeat-time 200
{% if not (ansible_distribution == "CentOS" and ansible_distribution_major_version|int <= 7) %}
# configure mouse # configure mouse
setw -g mouse on setw -g mouse on
{% endif %}
# don't rename windows automatically # don't rename windows automatically
set-option -g allow-rename off set-option -g allow-rename off
@ -27,12 +29,27 @@ setw -g pane-base-index 1
# status bar # status bar
#set -g status-right '#[fg=white]#(hostname)@#(host `hostname` | cut -d " " -f 4)' #set -g status-right '#[fg=white]#(hostname)@#(host `hostname` | cut -d " " -f 4)'
set-window-option -g status-left " #S " set-window-option -g status-left " #S "
{% if ansible_distribution == "CentOS" and ansible_distribution_major_version|int <= 7 %}
set-window-option -g status-left-fg black
set-window-option -g status-left-bg white
{% else %}
set-window-option -g status-left-style fg=black,bg=white set-window-option -g status-left-style fg=black,bg=white
{% endif %}
set-window-option -g status-right " %H:%M %Y-%m-%d | #(hostname) " set-window-option -g status-right " %H:%M %Y-%m-%d | #(hostname) "
{% if ansible_distribution == "CentOS" and ansible_distribution_major_version|int <= 7 %}
set-window-option -g status-right-fg black
set-window-option -g status-right-bg white
{% else %}
set-window-option -g status-right-style fg=black,bg=white set-window-option -g status-right-style fg=black,bg=white
{% endif %}
set-window-option -g window-status-format " #I: #W " set-window-option -g window-status-format " #I: #W "
set-window-option -g window-status-current-format " #I: #W " set-window-option -g window-status-current-format " #I: #W "
{% if ansible_distribution == "CentOS" and ansible_distribution_major_version|int <= 7 %}
set-window-option -g window-status-current-fg green
set-window-option -g window-status-current-bg black
{% else %}
set-window-option -g window-status-current-style fg=green,bg=black set-window-option -g window-status-current-style fg=green,bg=black
{% endif %}