diff --git a/ansible/playbook.yaml b/ansible/playbook.yaml index c9403b4..5f47f64 100644 --- a/ansible/playbook.yaml +++ b/ansible/playbook.yaml @@ -17,4 +17,5 @@ - graphics - gpg - fonts + - alacritty - sway diff --git a/ansible/roles/alacritty/files/alacritty.yml b/ansible/roles/alacritty/files/alacritty.yml new file mode 100644 index 0000000..a15e641 --- /dev/null +++ b/ansible/roles/alacritty/files/alacritty.yml @@ -0,0 +1,103 @@ +# If `true`, bold text is drawn using the bright color variants. +draw_bold_text_with_bright_colors: true + +colors: + # Default colors + primary: + background: "0x000000" + foreground: "0xeaeaea" + + # Bright and dim foreground colors + # + # The dimmed foreground color is calculated automatically if it is not present. + # If the bright foreground color is not set, or `draw_bold_text_with_bright_colors` + # is `false`, the normal foreground color will be used. + #dim_foreground: '0x9a9a9a' + #bright_foreground: '0xffffff' + + # Cursor colors + # + # Colors which should be used to draw the terminal cursor. If these are unset, + # the cursor color will be the inverse of the cell color. + #cursor: + # text: '0x000000' + # cursor: '0xffffff' + + # Selection colors + # + # Colors which should be used to draw the selection area. If selection + # background is unset, selection color will be the inverse of the cell colors. + # If only text is unset the cell text color will remain the same. + #selection: + # text: '0xeaeaea' + # background: '0x404040' + + # Normal colors + normal: + black: "0x000000" + red: "0xd54e53" + green: "0xb9ca4a" + yellow: "0xe6c547" + blue: "0x7aa6da" + magenta: "0xc397d8" + cyan: "0x70c0ba" + white: "0xeaeaea" + + # Bright colors + bright: + black: "0x666666" + red: "0xff3334" + green: "0x9ec400" + yellow: "0xe7c547" + blue: "0x7aa6da" + magenta: "0xb77ee0" + cyan: "0x54ced6" + white: "0xffffff" + + # Dim colors + # + # If the dim colors are not set, they will be calculated automatically based + # on the `normal` colors. + #dim: + # black: '0x000000' + # red: '0x8c3336' + # green: '0x7a8530' + # yellow: '0x97822e' + # blue: '0x506d8f' + # magenta: '0x80638e' + # cyan: '0x497e7a' + # white: '0x9a9a9a' + + # Indexed Colors + # + # The indexed colors include all colors from 16 to 256. + # When these are not set, they're filled with sensible defaults. + # + # Example: + # `- { index: 16, color: '0xff00ff' }` + # + indexed_colors: [] + +scrolling: + # Maximum number of lines in the scrollback buffer. + # Specifying '0' will disable scrolling. + history: 10000 + + # Number of lines the viewport will move for every line scrolled when + # scrollback is enabled (history > 0). + multiplier: 3 + +font: + size: 11.0 + +hints: + enabled: + # Disable opening links when clicked + - regex: + "(ipfs:|ipns:|magnet:|mailto:|gemini:|gopher:|https:|http:|news:|file:|git:|ssh:|ftp:)\ + [^\u0000-\u001F\u007F-\u009F<>\"\\s{-}\\^⟨⟩`]+" + command: xdg-open + post_processing: true + mouse: + enabled: false + mods: None diff --git a/ansible/roles/alacritty/meta/main.yaml b/ansible/roles/alacritty/meta/main.yaml new file mode 100644 index 0000000..63a2741 --- /dev/null +++ b/ansible/roles/alacritty/meta/main.yaml @@ -0,0 +1,3 @@ +dependencies: + - users + - fonts diff --git a/ansible/roles/alacritty/tasks/common.yaml b/ansible/roles/alacritty/tasks/common.yaml new file mode 100644 index 0000000..62421de --- /dev/null +++ b/ansible/roles/alacritty/tasks/common.yaml @@ -0,0 +1,20 @@ +- name: Install packages + package: + name: + - alacritty + state: present + +- import_tasks: tasks/freebsd.yaml + when: 'os_flavor == "freebsd"' + +- import_tasks: tasks/linux.yaml + when: 'os_flavor == "linux"' + +- include_tasks: + file: tasks/peruser.yaml + apply: + become: yes + become_user: "{{ initialize_user }}" + loop: "{{ users | dict2items | community.general.json_query('[?value.initialize==`true`].key') }}" + loop_control: + loop_var: initialize_user diff --git a/ansible/roles/alacritty/tasks/freebsd.yaml b/ansible/roles/alacritty/tasks/freebsd.yaml new file mode 100644 index 0000000..b417174 --- /dev/null +++ b/ansible/roles/alacritty/tasks/freebsd.yaml @@ -0,0 +1,5 @@ +# - name: Install packages +# package: +# name: +# - foo +# state: present diff --git a/ansible/roles/alacritty/tasks/linux.yaml b/ansible/roles/alacritty/tasks/linux.yaml new file mode 100644 index 0000000..e1835f0 --- /dev/null +++ b/ansible/roles/alacritty/tasks/linux.yaml @@ -0,0 +1,6 @@ +# - name: Install packages +# pacman: +# name: +# - foo +# state: present +# update_cache: true diff --git a/ansible/roles/alacritty/tasks/main.yaml b/ansible/roles/alacritty/tasks/main.yaml new file mode 100644 index 0000000..dc9939d --- /dev/null +++ b/ansible/roles/alacritty/tasks/main.yaml @@ -0,0 +1,2 @@ +- import_tasks: tasks/common.yaml + when: graphics_driver is defined diff --git a/ansible/roles/alacritty/tasks/peruser.yaml b/ansible/roles/alacritty/tasks/peruser.yaml new file mode 100644 index 0000000..3c76ba7 --- /dev/null +++ b/ansible/roles/alacritty/tasks/peruser.yaml @@ -0,0 +1,29 @@ +- include_role: + name: per_user + +- name: Create directories + file: + name: "{{ account_homedir.stdout }}/{{ item }}" + state: directory + mode: 0700 + owner: "{{ account_name.stdout }}" + group: "{{ group_name.stdout }}" + loop: + - ".config/alacritty" + +- name: Copy files + copy: + src: "files/{{ item.src }}" + dest: "{{ account_homedir.stdout }}/{{ item.dest }}" + mode: 0600 + owner: "{{ account_name.stdout }}" + group: "{{ group_name.stdout }}" + loop: + - src: alacritty.yml + dest: .config/alacritty/alacritty.yml + +- import_tasks: tasks/peruser_freebsd.yaml + when: 'os_flavor == "freebsd"' + +- import_tasks: tasks/peruser_linux.yaml + when: 'os_flavor == "linux"' diff --git a/ansible/roles/alacritty/tasks/peruser_freebsd.yaml b/ansible/roles/alacritty/tasks/peruser_freebsd.yaml new file mode 100644 index 0000000..e69de29 diff --git a/ansible/roles/alacritty/tasks/peruser_linux.yaml b/ansible/roles/alacritty/tasks/peruser_linux.yaml new file mode 100644 index 0000000..e69de29