From 66444c69a6fc6a26c31680e4138b89d43edd8e53 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Sat, 30 Apr 2022 16:34:04 +0100 Subject: [PATCH] Add a tmux role for Debian, Arch, Fedora, and macOS --- main.yaml | 1 + roles/tmux/tasks/Archlinux.yaml | 8 +++++++ roles/tmux/tasks/Darwin.yaml | 9 ++++++++ roles/tmux/tasks/Debian.yaml | 12 ++++++++++ roles/tmux/tasks/Fedora.yaml | 10 +++++++++ roles/tmux/tasks/main.yaml | 39 +++++++++++++++++++++++++++++++++ 6 files changed, 79 insertions(+) create mode 100644 roles/tmux/tasks/Archlinux.yaml create mode 100644 roles/tmux/tasks/Darwin.yaml create mode 100644 roles/tmux/tasks/Debian.yaml create mode 100644 roles/tmux/tasks/Fedora.yaml create mode 100644 roles/tmux/tasks/main.yaml diff --git a/main.yaml b/main.yaml index a93d22f..34ed283 100644 --- a/main.yaml +++ b/main.yaml @@ -2,6 +2,7 @@ - hosts: localhost roles: - zsh + - tmux - neovim - hosts: windows diff --git a/roles/tmux/tasks/Archlinux.yaml b/roles/tmux/tasks/Archlinux.yaml new file mode 100644 index 0000000..61bac0e --- /dev/null +++ b/roles/tmux/tasks/Archlinux.yaml @@ -0,0 +1,8 @@ +--- +- name: install pacman packages + pacman: + name: + - tmux + - xclip + - urlscan + state: latest diff --git a/roles/tmux/tasks/Darwin.yaml b/roles/tmux/tasks/Darwin.yaml new file mode 100644 index 0000000..6eabb95 --- /dev/null +++ b/roles/tmux/tasks/Darwin.yaml @@ -0,0 +1,9 @@ +--- +- name: install homebrew packages + homebrew: + name: + - tmux + - osx-cpu-temp + - reattach-to-user-namespace + - urlview + state: latest diff --git a/roles/tmux/tasks/Debian.yaml b/roles/tmux/tasks/Debian.yaml new file mode 100644 index 0000000..d0783f6 --- /dev/null +++ b/roles/tmux/tasks/Debian.yaml @@ -0,0 +1,12 @@ +--- +- name: install apt packages + become: true + package: + name: + - tmux + - gawk + - jq + - sysstat + - urlview + - xclip + state: latest diff --git a/roles/tmux/tasks/Fedora.yaml b/roles/tmux/tasks/Fedora.yaml new file mode 100644 index 0000000..304de39 --- /dev/null +++ b/roles/tmux/tasks/Fedora.yaml @@ -0,0 +1,10 @@ +--- +- name: install dnf packages + dnf: + name: + - tmux + - xclip + - urlscan + - sysstat + - jq + state: latest diff --git a/roles/tmux/tasks/main.yaml b/roles/tmux/tasks/main.yaml new file mode 100644 index 0000000..b27b05d --- /dev/null +++ b/roles/tmux/tasks/main.yaml @@ -0,0 +1,39 @@ +--- +- include_tasks: '{{ansible_os_family}}.yaml' + +- name: clone config repo + git: + repo: git@code.infektor.net:config/tmux.git + dest: ~/.config/tmux + version: master + +# TODO: - name: set repo email + +- name: create layouts directory + file: + state: directory + dest: ~/.local/share/tmux/layouts + +- name: create symbolic links + file: + state: link + src: '{{item.src}}' + dest: '{{item.dest}}' + with_items: + - src: ~/.config/tmux/tmux.conf + dest: ~/.tmux.conf + - src: ~/.config/tmux/layouts/session-main + dest: ~/.local/share/tmux/layouts/session-main + - src: ~/.config/tmux/layouts/window-tall + dest: ~/.local/share/tmux/layouts/window-tall + - src: ~/.config/tmux/layouts/window-wide-left + dest: ~/.local/share/tmux/layouts/window-wide-left + - src: ~/.config/tmux/layouts/window-wide-right + dest: ~/.local/share/tmux/layouts/window-wide-right + +# TODO: - name: Enable tmux system-info service +# command: system-info/install.sh + +# TODO: WSL2 system-info +# when: '"WSL" in ansible_kernel' +# figure out best way to run daemon...