From 5f396740922e939a912d2ab7b6d7c771268e9625 Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Tue, 28 Jul 2026 15:07:37 +0200 Subject: [PATCH] Share desktop tmux config with WSL --- .../group_vars/workstation_dev_wsl.yml | 5 ++++ .../tasks/main.yml | 15 ++++++++++- dotfiles/workstation_dev_wsl/.tmux.conf | 27 ------------------- 3 files changed, 19 insertions(+), 28 deletions(-) delete mode 100644 dotfiles/workstation_dev_wsl/.tmux.conf diff --git a/ansible/inventory/group_vars/workstation_dev_wsl.yml b/ansible/inventory/group_vars/workstation_dev_wsl.yml index ed368ec..d5fee94 100644 --- a/ansible/inventory/group_vars/workstation_dev_wsl.yml +++ b/ansible/inventory/group_vars/workstation_dev_wsl.yml @@ -28,3 +28,8 @@ workstation_dev_wsl_dotfiles: - src: .tmux.conf dest: .tmux.conf mode: "0644" + source_dir: desktop + - src: .tmux/bin/ + dest: .tmux/bin/ + mode: preserve + source_dir: desktop diff --git a/ansible/roles/profile_workstation_dev_wsl/tasks/main.yml b/ansible/roles/profile_workstation_dev_wsl/tasks/main.yml index e6eda45..c6d4085 100644 --- a/ansible/roles/profile_workstation_dev_wsl/tasks/main.yml +++ b/ansible/roles/profile_workstation_dev_wsl/tasks/main.yml @@ -1,8 +1,21 @@ --- +- name: Ensure WSL tmux directories exist + tags: [dotfiles, dotfiles:workstation, tmux, wsl] + ansible.builtin.file: + path: "{{ user_home }}/{{ item }}" + state: directory + owner: "{{ username }}" + group: "{{ user_group }}" + mode: "0755" + loop: + - .tmux + - .tmux/bin + - .tmux/plugins + - name: Copy workstation WSL dotfiles tags: [dotfiles, dotfiles:workstation, wsl] ansible.builtin.copy: - src: "{{ playbook_dir }}/../dotfiles/workstation_dev_wsl/{{ item.src }}" + src: "{{ playbook_dir }}/../dotfiles/{{ item.source_dir | default('workstation_dev_wsl') }}/{{ item.src }}" dest: "{{ user_home }}/{{ item.dest }}" owner: "{{ username }}" group: "{{ user_group }}" diff --git a/dotfiles/workstation_dev_wsl/.tmux.conf b/dotfiles/workstation_dev_wsl/.tmux.conf deleted file mode 100644 index e46cf4b..0000000 --- a/dotfiles/workstation_dev_wsl/.tmux.conf +++ /dev/null @@ -1,27 +0,0 @@ -# Prefix and Emacs-style key handling -unbind C-b -set -g prefix C-x -bind C-x send-prefix -set -g status-keys emacs -setw -g mode-keys emacs - -# General behavior -set -g mouse on -set -g base-index 1 -setw -g pane-base-index 1 -set -g renumber-windows on -set -g history-limit 10000 -set -s escape-time 0 -set -g focus-events on - -# Keep the current directory when creating windows and panes -bind c new-window -c "#{pane_current_path}" -bind '"' split-window -v -c "#{pane_current_path}" -bind % split-window -h -c "#{pane_current_path}" - -# Reload the configuration with C-x r -bind r source-file ~/.tmux.conf \; display-message "tmux configuration reloaded" - -# Terminal capabilities -set -g default-terminal "tmux-256color" -set -as terminal-features ",xterm-256color:RGB"