From 46ac99bca9147d42d5d85b0d861bf4e233541bf3 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 3 Dec 2018 22:00:17 +0000 Subject: [PATCH] Switch default shell to tmux --- files/alacritty.yml | 6 ++---- files/tmux.conf | 14 ++++++++++++++ files/zshrc/.zshrc | 2 +- files/zshrc/applications.sh | 1 + tasks/shell.yml | 9 ++++++++- 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/files/alacritty.yml b/files/alacritty.yml index 1ced980..2657568 100644 --- a/files/alacritty.yml +++ b/files/alacritty.yml @@ -306,10 +306,8 @@ live_config_reload: true # # You can set `shell.program` to the path of your favorite shell, e.g. `/bin/fish`. # Entries in `shell.args` are passed unmodified as arguments to the shell. -#shell: -# program: /bin/bash -# args: -# - --login +shell: + program: /sbin/tmux # Key bindings # diff --git a/files/tmux.conf b/files/tmux.conf index 0e63b1f..40f4fa6 100644 --- a/files/tmux.conf +++ b/files/tmux.conf @@ -4,3 +4,17 @@ set -g history-limit 1000 set -g terminal-overrides 'xterm*:smcup@:rmcup@' set-window-option -g mouse on set-window-option -g mode-keys vi + +unbind C-b +set -g prefix ISO_Level3_Shift +bind ISO_Level3_Shift send-prefix +source-file "{{ home }}/.tmux/plugins/tmux-themepack/basic.tmuxtheme" + +set-window-option -g automatic-rename on +set-option -g set-titles on +set-option -g set-titles-string '#T: #W' + +# auto even horizontal splits +set-hook -g after-split-window 'select-layout even-vertical' +set-hook -g after-kill-pane 'select-layout even-vertical' +set-hook -g pane-exited 'select-layout even-vertical' diff --git a/files/zshrc/.zshrc b/files/zshrc/.zshrc index 0c06d3e..2888bf8 100644 --- a/files/zshrc/.zshrc +++ b/files/zshrc/.zshrc @@ -26,7 +26,7 @@ autoload -Uz colors && colors local ret_status="%(?:%{$fg_bold[green]%}λ :%{$fg_bold[red]%}λ )" export PROMPT="${ret_status} %{$fg_bold[green]%}%n@%m%{$reset_color%}:%{$fg_bold[blue]%}%~%{$reset_color%}$ " -alias src="source $HOME/.zshrc" +alias src="source {{ home }}/.zshrc && tmux source {{ home }}/.tmux.conf" {% include "base.sh" %} {% include "environment.sh" %} diff --git a/files/zshrc/applications.sh b/files/zshrc/applications.sh index 9e61991..ce3a3a7 100644 --- a/files/zshrc/applications.sh +++ b/files/zshrc/applications.sh @@ -51,3 +51,4 @@ alias yolo="yaourt -Syyau --noconfirm" alias sc="screenshot --to img" alias clip="xclip -selection clipboard" alias cl="climate" +alias tmux-cleanup="tmux list-sessions | grep -v attached | cut -d: -f1 | xargs -t -n1 tmux kill-session -t" diff --git a/tasks/shell.yml b/tasks/shell.yml index 5448060..ccdaa36 100644 --- a/tasks/shell.yml +++ b/tasks/shell.yml @@ -14,9 +14,16 @@ owner: root group: root -- copy: +- template: src: ./files/tmux.conf dest: "{{ home }}/.tmux.conf" mode: 0755 owner: "{{ user }}" group: users + +- git: + repo: git@github.com:jimeh/tmux-themepack.git + dest: "{{ home }}/.tmux/plugins/tmux-themepack" + force: true + become: true + become_user: "{{ user }}"