Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions ansible/files/tmux.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Keep the default prefix
set-option -g prefix C-b

# Add Ctrl-a as a second prefix
set-option -g prefix2 C-a

# Ensure that pressing Ctrl-a twice sends the prefix to the inner application
# (Useful for nested tmux sessions or programs that use Ctrl-a)
bind-key C-a send-prefix -2

# split panes using | and -
bind | split-window -h
bind - split-window -v

# switch panes using Alt-arrow without prefix
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D

# Enable mouse control (clickable windows, panes, resizable panes)
set -g mouse on

# DESIGN TWEAKS

# don't do anything when a 'bell' rings
set -g visual-activity off
set -g visual-bell off
set -g visual-silence off
setw -g monitor-activity off
set -g bell-action none

# clock mode
setw -g clock-mode-colour yellow

# copy mode
setw -g mode-style 'fg=black bg=red bold'

# panes
set -g pane-border-style 'fg=red'
set -g pane-active-border-style 'fg=yellow'

# statusbar
set -g status-position bottom
set -g status-justify left
set -g status-style 'fg=red'

set -g status-left ''
set -g status-left-length 10

set -g status-right-style 'fg=black bg=yellow'
set -g status-right '%Y-%m-%d %H:%M '
set -g status-right-length 50

setw -g window-status-current-style 'fg=black bg=red'
setw -g window-status-current-format ' #I #W #F '

setw -g window-status-style 'fg=red bg=black'
setw -g window-status-format ' #I #[fg=white]#W #[fg=yellow]#F '

setw -g window-status-bell-style 'fg=yellow bg=red bold'

# messages
set -g message-style 'fg=yellow bg=red bold'
3 changes: 3 additions & 0 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
- name: Install tuned
import_tasks: tasks/setup-tuned.yml

- name: Install tmux
import_tasks: tasks/setup-tmux.yml

- name: Install Postgres from source
import_tasks: tasks/setup-postgres.yml

Expand Down
44 changes: 44 additions & 0 deletions ansible/tasks/setup-tmux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
- name: tmux - Install tmux
ansible.builtin.apt:
name: 'tmux'
state: 'present'
update_cache: true
become: true
Comment thread
hunleyd marked this conversation as resolved.

- name: tmux - Configure shell auto-logout
ansible.builtin.copy:
content: |
case "$-" in
*i*) export TMOUT=600 ;;
esac
dest: '/etc/profile.d/11-shell_timeout.sh'
group: 'root'
mode: '0644'
owner: 'root'
become: true
Comment thread
hunleyd marked this conversation as resolved.

- name: tmux - Configure tmux
ansible.builtin.template:
dest: '/etc/tmux.conf'
group: 'root'
mode: '0644'
owner: 'root'
src: 'files/tmux.conf.j2'
become: true

- name: tmux - Auto-launch tmux as needed
ansible.builtin.copy:
content: |
case "$-" in
*i*)
case "$TERM" in
tmux*) ;;
*) tmux new-session -A -s supa ;;
esac
;;
esac
dest: '/etc/profile.d/12-tmux.sh'
group: 'root'
mode: '0644'
owner: 'root'
become: true
Comment thread
hunleyd marked this conversation as resolved.
6 changes: 3 additions & 3 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ postgres_major:

# Full version strings for each major version
postgres_release:
postgresorioledb-17: "17.6.0.064-orioledb"
postgres17: "17.6.1.107"
postgres15: "15.14.1.107"
postgresorioledb-17: "17.6.0.064-orioledb-indata574-1"
postgres17: "17.6.1.107-indata574-1"
postgres15: "15.14.1.107-indata574-1"

# Non Postgres Extensions
pgbouncer_release: 1.25.1
Expand Down
Loading