From ba6a8708c220c2e5b71b52da434e7d39a76e23ee Mon Sep 17 00:00:00 2001 From: Ricard Illa Date: Sun, 4 Sep 2022 18:57:47 +0200 Subject: [PATCH] quality of life tools role --- deploy.yml | 3 ++ roles/quality_of_life/files/tmux.conf | 74 +++++++++++++++++++++++++++ roles/quality_of_life/tasks/main.yml | 45 ++++++++++++++++ 3 files changed, 122 insertions(+) create mode 100644 roles/quality_of_life/files/tmux.conf create mode 100644 roles/quality_of_life/tasks/main.yml diff --git a/deploy.yml b/deploy.yml index 0aa190f..b8a3fc1 100644 --- a/deploy.yml +++ b/deploy.yml @@ -26,6 +26,7 @@ - basic - users - sshd + - quality_of_life - tinyproxy vars: users: @@ -42,6 +43,7 @@ - basic - users - sshd + - quality_of_life vars: users: - rilla @@ -56,6 +58,7 @@ - basic - users - sshd + - quality_of_life vars: users: - rilla diff --git a/roles/quality_of_life/files/tmux.conf b/roles/quality_of_life/files/tmux.conf new file mode 100644 index 0000000..2df7ca6 --- /dev/null +++ b/roles/quality_of_life/files/tmux.conf @@ -0,0 +1,74 @@ +# set -g default-terminal "screen-256color" +set -g default-terminal "tmux-256color" +#set -g default-terminal "alacritty" +set-option -sa terminal-overrides ',alacritty:RGB' + +set-option -g prefix C-a + +setw -g mode-keys vi + +bind h select-pane -L +bind j select-pane -D +bind k select-pane -U +bind l select-pane -R + +bind -n M-m resize-pane -Z + +bind-key -T copy-mode-vi 'C-h' select-pane -L +bind-key -T copy-mode-vi 'C-j' select-pane -D +bind-key -T copy-mode-vi 'C-k' select-pane -U +bind-key -T copy-mode-vi 'C-l' select-pane -R + +bind 1 select-window -t 1 +bind 2 select-window -t 2 +bind 3 select-window -t 3 +bind 4 select-window -t 4 +bind 5 select-window -t 5 +bind 6 select-window -t 6 +bind 7 select-window -t 7 +bind 8 select-window -t 8 +bind 9 select-window -t 9 + +bind -n M-p select-window -p +bind -n M-n select-window -n + +set -g base-index 1 +setw -g pane-base-index 1 + +unbind p +bind-key -T copy-mode-vi y \ + send-keys -X copy-pipe-and-cancel "xsel -i -p && xsel -o -p | xsel -i -b" +bind-key p run "xsel -o | tmux load-buffer - ; tmux paste-buffer" + +bind c new-window -c "#{pane_current_path}" +bind = split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" + +bind r source-file ~/.tmux.conf + +set-option -g automatic-rename on + +set -g mouse on + +set -sg escape-time 0 + + +set -g status-left-length 32 +set -g status-right-length 150 + +set -g status-fg '#ebdbb2' +set -g status-bg '#282828' +#set -g window-status-activity-attr bold +#set -g pane-border-fg '#7f8289' +#set -g pane-active-border-fg '#458588' +#set -g message-bg '#282828' +#set -g message-fg '#ebdbb2' +#set -g message-attr bold + +setw -g window-status-separator ' ' +set -g status-left '#[bg=#ebdbb2,fg=#282828,bold] #H #[bg=#282828] ' +set -g window-status-format "#[fg=#ebdbb2,bg=#a89974] #I #[fg=#a89974,bg=#282828]#[fg=#a89974,bg=#282828] #W " +set -g window-status-current-format "#[fg=#fbf1c7,bg=#458588,noreverse,bold] #I #[fg=#458588,bg=#282828]#[fg=#fbf1c7,bg=#282828,noreverse,bold] #W " + +#set -g status-right '#[bg=#282828,fg=#665c54]#[fg=#282828,bg=#665c54,bold] %a %b %d #[fg=#7c6f64,bg=#665c54]#[bg=#7c6f64,fg=#282828,bold] %I:%M #[bg=#7c6f64,fg=#c0c5ce,bold]#[fg=#282828,bg=#c0c5ce,bold] #H ' +set -g status-right '' diff --git a/roles/quality_of_life/tasks/main.yml b/roles/quality_of_life/tasks/main.yml new file mode 100644 index 0000000..c69bc93 --- /dev/null +++ b/roles/quality_of_life/tasks/main.yml @@ -0,0 +1,45 @@ +--- +- name: quality of life packages + apk: + name: + - htop + - mksh # I want something somewhat nicer thant busybox ash + - mosh + - neovim + - ripgrep + - tmux + when: ansible_distribution == "Alpine" + +- name: install python3 + apt: + name: + - htop + - mosh + - neovim + - ripgrep + - tmux + when: ansible_distribution in ["Debian", "Ubuntu"] + +- name: install python3 + openbsd_pkg: + name: + - htop + - mosh + - neovim + - ripgrep + # OpenBSD already ships with tmux + when: ansible_distribution == "OpenBSD" + +- name: make tmux config directory + file: + path: /home/rilla/.config/tmux + state: directory + owner: rilla + group: rilla + +- name: copy tmux config + copy: + src: tmux.conf + dest: /home/rilla/.config/tmux/tmux.conf + owner: rilla + group: rilla