dotfiles/config/automatrop/roles/desktop_environment/tasks/main.yml

180 lines
5.6 KiB
YAML
Raw Permalink Normal View History

2023-11-02 19:51:54 +01:00
---
- name: Ensure directories for desktop applications are present
2023-11-02 19:51:54 +01:00
ansible.builtin.file:
2020-10-18 13:01:24 +02:00
state: directory
path: "{{ ansible_user_dir }}/{{ item }}"
2023-11-02 19:51:54 +01:00
mode: u=rwx,g=rx,o=rx
2020-10-18 13:01:24 +02:00
with_items:
2023-11-02 19:51:54 +01:00
- .config/Xresources
- .config/rofi
- .local/bin
- .local/share/fonts
- .config/qutebrowser
- .config/tridactyl/themes
2020-10-18 13:01:24 +02:00
# Download fonts
2021-07-04 09:52:16 +02:00
- name: Download Nerd fonts
2023-11-02 19:51:54 +01:00
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/ryanoasis/nerd-fonts/704336735f576781b2a57b12a0c723e3316cbdec/patched-fonts/DejaVuSansMono/{{ item.folder }}/complete/{{
item.filename | urlencode }}
2021-07-04 09:52:16 +02:00
dest: "{{ ansible_user_dir }}/.local/share/fonts/{{ item.filename }}"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
loop:
2021-07-04 09:52:16 +02:00
- filename: DejaVu Sans Mono Bold Nerd Font Complete Mono.ttf
folder: Bold
- filename: DejaVu Sans Mono Bold Oblique Nerd Font Complete Mono.ttf
folder: Bold-Italic
- filename: DejaVu Sans Mono Nerd Font Complete Mono.ttf
folder: Regular
- filename: DejaVu Sans Mono Oblique Nerd Font Complete Mono.ttf
folder: Italic
- name: Download icon fonts
2023-11-02 19:51:54 +01:00
ansible.builtin.get_url:
url: https://raw.githubusercontent.com/FortAwesome/Font-Awesome/a8386aae19e200ddb0f6845b5feeee5eb7013687/fonts/fontawesome-webfont.ttf
dest: "{{ ansible_user_dir }}/.local/share/fonts/fontawesome-webfont.ttf"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
2021-07-04 09:52:16 +02:00
# TODO Either replace with ForkAwesome or Nerd Fonts
- name: Install python dependencies for lemonbar
2023-11-02 19:51:54 +01:00
ansible.builtin.pip:
requirements: "{{ ansible_user_dir }}/.dotfiles/config/lemonbar/requirements.txt"
2023-11-02 19:50:00 +01:00
extra_args: --break-system-packages # It's fine, it's local anyways
2021-01-09 18:58:18 +01:00
# Build a single color scheme and template and assign it to a variable
- base16_builder:
scheme: "{{ base16_scheme }}"
template: # This requires https://github.com/mnussbaum/base16-builder-ansible/pull/6
- i3
- xresources
- rofi
- alacritty
- shell
- fzf
- vim
- qutebrowser
- tridactyl
- dunst
register: base16_schemes
tags:
- color
2022-12-08 10:57:28 +01:00
- i3
2021-01-09 18:58:18 +01:00
2021-01-10 14:55:27 +01:00
- name: Configure Alacritty
2023-11-02 19:51:54 +01:00
ansible.builtin.template:
2021-01-10 14:55:27 +01:00
src: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml.j2"
dest: "{{ ansible_env.HOME }}/.config/alacritty/alacritty.yml"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
# Alacritty has live config reload, so no command to execute
# However, it doesn't work with yaml includes, hence the template
tags:
- color
2021-01-10 14:55:27 +01:00
2021-01-09 18:58:18 +01:00
- name: Set base16 theme for Xresources
2023-11-02 19:51:54 +01:00
ansible.builtin.copy:
2021-01-09 18:58:18 +01:00
content: "{{ base16_schemes['schemes'][base16_scheme]['xresources']['xresources']['base16-' + base16_scheme + '-256.Xresources'] }}"
2020-10-18 13:01:24 +02:00
dest: "{{ ansible_env.HOME }}/.config/Xresources/theme"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
2020-10-18 13:01:24 +02:00
notify:
- xrdb-reload
tags:
- color
when: display_server == 'x11'
2020-10-18 13:01:24 +02:00
2021-01-10 14:55:27 +01:00
- name: Download base16 theme for qutebrowser
2023-11-02 19:51:54 +01:00
ansible.builtin.copy:
2021-01-10 14:55:27 +01:00
content: "{{ base16_schemes['schemes'][base16_scheme]['qutebrowser']['themes/minimal']['base16-' + base16_scheme + '.config.py'] }}"
dest: "{{ ansible_env.HOME }}/.config/qutebrowser/theme.py"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
2021-01-10 14:55:27 +01:00
notify:
- qutebrowser-reload
tags:
- color
2021-01-10 14:55:27 +01:00
- name: Download base16 theme for Tridactyl
2023-11-02 19:51:54 +01:00
ansible.builtin.copy:
2021-01-10 14:55:27 +01:00
content: "{{ base16_schemes['schemes'][base16_scheme]['tridactyl']['base16-' + base16_scheme + '.config.py'] }}"
# url: "https://raw.githubusercontent.com/bezmi/base16-tridactyl/master/base16-{{ base16_scheme }}.css"
dest: "{{ ansible_env.HOME }}/.config/tridactyl/themes/theme.css"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
when: false # Not currently used
tags:
- color
2021-01-10 14:55:27 +01:00
2020-10-18 13:01:24 +02:00
- name: Configure i3
2023-11-02 19:51:54 +01:00
ansible.builtin.template:
2020-10-18 13:01:24 +02:00
src: "{{ ansible_env.HOME }}/.config/i3/config.j2"
dest: "{{ ansible_env.HOME }}/.config/i3/config"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
2020-10-18 13:01:24 +02:00
notify:
- i3-reload
tags:
- color
2022-12-08 10:57:28 +01:00
- i3
when: display_server == 'x11'
2020-10-18 13:01:24 +02:00
- name: Set base16 theme for rofi
2023-11-02 19:51:54 +01:00
ansible.builtin.copy:
content: "{{ base16_schemes['schemes'][base16_scheme]['rofi']['themes']['base16-' + base16_scheme + '.' + item] }}"
dest: "{{ ansible_env.HOME }}/.config/rofi/theme.{{ item }}"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
2021-12-15 21:59:45 +01:00
tags:
- color
loop:
- config
- rasi
2020-10-18 13:01:24 +02:00
2021-01-10 14:55:27 +01:00
- name: Configure Dunst
2023-11-02 19:51:54 +01:00
ansible.builtin.template:
2021-01-10 14:55:27 +01:00
src: "{{ ansible_env.HOME }}/.config/dunst/dunstrc.j2"
dest: "{{ ansible_env.HOME }}/.config/dunst/dunstrc"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
tags:
- color
when: display_server == 'x11'
2021-01-10 14:55:27 +01:00
- name: Download base16 theme for fzf
2023-11-02 19:51:54 +01:00
ansible.builtin.copy:
2021-01-10 14:55:27 +01:00
content: "{{ base16_schemes['schemes'][base16_scheme]['fzf']['bash']['base16-' + base16_scheme + '.config'] }}"
dest: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApplyFzf"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
2021-01-10 14:55:27 +01:00
notify:
- fzf-reload
tags:
- color
2021-01-10 14:55:27 +01:00
2020-10-18 13:01:24 +02:00
- name: Download base16 theme for shell
2023-11-02 19:51:54 +01:00
ansible.builtin.copy:
2021-01-09 18:58:18 +01:00
content: "{{ base16_schemes['schemes'][base16_scheme]['shell']['script']['base16-' + base16_scheme + '.sh'] }}"
2020-10-18 13:01:24 +02:00
dest: "{{ ansible_env.HOME }}/.local/bin/colorSchemeApply"
2023-11-02 19:51:54 +01:00
mode: u=rwx,g=rx,o=rx
2020-10-18 13:01:24 +02:00
notify:
- shell-reload
2023-11-02 19:51:54 +01:00
when: false # Not currently used
tags:
- color
2020-10-18 13:01:24 +02:00
- name: Set used base16 theme for vim
2023-11-02 19:51:54 +01:00
ansible.builtin.copy:
2020-10-18 13:01:24 +02:00
path: "{{ ansible_env.HOME }}/.config/vim/colorscheme.vim"
2023-11-02 19:51:54 +01:00
mode: u=rw,g=r,o=r
content: colorscheme base16-{{ base16_scheme }}
when: false # Not currently used
tags:
- color
2020-10-18 13:01:24 +02:00
- name: Enable user services
2023-11-02 19:51:54 +01:00
ansible.builtin.systemd:
name: "{{ item }}"
state: started
2023-11-02 19:51:54 +01:00
enabled: true
scope: user
loop:
- pulseaudio
- mpd
2021-12-02 16:55:55 +01:00
when: has_systemd
2020-10-18 13:01:24 +02:00
# TODO bar (might change bar in the future, so...)
# TODO highlight (there IS a template but the colors look different from vim and mostly the same from when there's no config)
# TODO https://github.com/makuto/auto-base16-theme ? :P