Move fonts installation to new fonts role
This commit is contained in:
parent
f004ffe1df
commit
d7ff945b30
7 changed files with 62 additions and 90 deletions
|
@ -1,3 +1,2 @@
|
|||
---
|
||||
- name: Reload font cache
|
||||
command: fc-cache -fv
|
4
roles/fonts/meta/main.yml
Normal file
4
roles/fonts/meta/main.yml
Normal file
|
@ -0,0 +1,4 @@
|
|||
---
|
||||
dependencies:
|
||||
- role: check-sudo
|
||||
- role: git
|
56
roles/fonts/tasks/main.yml
Normal file
56
roles/fonts/tasks/main.yml
Normal file
|
@ -0,0 +1,56 @@
|
|||
---
|
||||
- name: Install packages (Archlinux)
|
||||
when: ansible_facts['distribution'] == 'Archlinux'
|
||||
become: true
|
||||
pacman:
|
||||
name:
|
||||
- ttf-font-awesome
|
||||
|
||||
- name: Install packages (Debian)
|
||||
when: ansible_facts['distribution'] == 'Debian'
|
||||
become: true
|
||||
apt:
|
||||
name:
|
||||
- fonts-font-awesome
|
||||
|
||||
- name: Install Nerd Fonts patch of FiraCode (Archlinux)
|
||||
when: ansible_facts['distribution'] == 'Archlinux'
|
||||
block:
|
||||
- name: Clone nerd-fonts-fira-code (Archlinux)
|
||||
git:
|
||||
repo: https://aur.archlinux.org/nerd-fonts-fira-code.git
|
||||
dest: ~/builds/nerd-fonts-fira-code
|
||||
clone: true
|
||||
update: false
|
||||
version: master
|
||||
- name: Make and install nerd-fonts-fira-code (Archlinux)
|
||||
command:
|
||||
cmd: makepkg -cirs --needed
|
||||
chdir: ~/builds/nerd-fonts-fira-code
|
||||
stdin: Y
|
||||
register: result
|
||||
changed_when: "'installing existing package' not in result.stderr"
|
||||
notify: Reload font cache
|
||||
|
||||
- name: Install Nerd Fonts patch of FiraCode (Debian)
|
||||
when: ansible_facts['distribution'] == 'Debian'
|
||||
block:
|
||||
- name: Create local fonts directory
|
||||
file:
|
||||
path: ~/.local/share/fonts
|
||||
state: directory
|
||||
mode: 0755
|
||||
- name: Find latest nerdfonts version
|
||||
uri:
|
||||
url: https://github.com/ryanoasis/nerd-fonts/releases/latest
|
||||
register: latest_http_content
|
||||
- name: Set latest nerdfonts version
|
||||
set_fact:
|
||||
nerdfonts_version: "{{ latest_http_content.url | split('/') | last }}"
|
||||
- name: Get latest Nerd Fonts FiraCode zipfile
|
||||
unarchive:
|
||||
src: "https://github.com/ryanoasis/nerd-fonts/releases/download/{{ nerdfonts_version }}/FiraCode.zip"
|
||||
remote_src: true
|
||||
dest: ~/.local/share/fonts/
|
||||
mode: 0644
|
||||
notify: Reload font cache
|
|
@ -2,3 +2,4 @@
|
|||
dependencies:
|
||||
- role: check-sudo
|
||||
- role: git
|
||||
- role: fonts
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
- numlockx # activate numlock (set in .xinitrc)
|
||||
- scrot
|
||||
- sysstat
|
||||
- ttf-font-awesome
|
||||
- udiskie # automount external drives (set in .xinitrc)
|
||||
- upower
|
||||
- viewnior
|
||||
|
@ -35,7 +34,6 @@
|
|||
name:
|
||||
- aptitude
|
||||
- dunst
|
||||
- fonts-font-awesome
|
||||
- hsetroot
|
||||
- i3-wm
|
||||
- i3lock
|
||||
|
@ -59,48 +57,6 @@
|
|||
- xsettingsd
|
||||
when: ansible_facts['distribution'] == 'Debian'
|
||||
|
||||
- name: Install Nerd Fonts patch of FiraCode (Archlinux)
|
||||
when: ansible_facts['distribution'] == 'Archlinux'
|
||||
block:
|
||||
- name: Clone nerd-fonts-fira-code (Archlinux)
|
||||
git:
|
||||
repo: https://aur.archlinux.org/nerd-fonts-fira-code.git
|
||||
dest: ~/builds/nerd-fonts-fira-code
|
||||
clone: true
|
||||
update: false
|
||||
version: master
|
||||
- name: Make and install nerd-fonts-fira-code (Archlinux)
|
||||
command:
|
||||
cmd: makepkg -cirs --needed
|
||||
chdir: ~/builds/nerd-fonts-fira-code
|
||||
stdin: Y
|
||||
register: result
|
||||
changed_when: "'installing existing package' not in result.stderr"
|
||||
notify: Reload font cache
|
||||
|
||||
- name: Install Nerd Fonts patch of FiraCode (Debian)
|
||||
when: ansible_facts['distribution'] == 'Debian'
|
||||
block:
|
||||
- name: Create local fonts directory
|
||||
file:
|
||||
path: ~/.local/share/fonts
|
||||
state: directory
|
||||
mode: 0755
|
||||
- name: Find latest nerdfonts version
|
||||
uri:
|
||||
url: https://github.com/ryanoasis/nerd-fonts/releases/latest
|
||||
register: latest_http_content
|
||||
- name: Set latest nerdfonts version
|
||||
set_fact:
|
||||
nerdfonts_version: "{{ latest_http_content.url | split('/') | last }}"
|
||||
- name: Get latest Nerd Fonts FiraCode zipfile
|
||||
unarchive:
|
||||
src: "https://github.com/ryanoasis/nerd-fonts/releases/download/{{ nerdfonts_version }}/FiraCode.zip"
|
||||
remote_src: true
|
||||
dest: ~/.local/share/fonts/
|
||||
mode: 0644
|
||||
notify: Reload font cache
|
||||
|
||||
- name: Clone repos
|
||||
git: repo={{ item.repo }} dest={{ item.dest }} clone=true update=false version=master
|
||||
with_items:
|
||||
|
@ -166,9 +122,6 @@
|
|||
- {src: 'arch_linux_news', dest: '~/.config/i3blocks/scripts/arch_linux_news'}
|
||||
when: ansible_facts['distribution'] == 'Archlinux'
|
||||
|
||||
- name: Reload font cache
|
||||
command: fc-cache -fv
|
||||
|
||||
- name: Update user dirs
|
||||
command: xdg-user-dirs-update
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
---
|
||||
dependencies:
|
||||
- role: check-sudo
|
||||
- role: fonts
|
||||
|
|
|
@ -13,48 +13,6 @@
|
|||
- terminator
|
||||
when: ansible_facts['distribution'] == 'Debian'
|
||||
|
||||
- name: Install Nerd Fonts patch of FiraCode (Archlinux)
|
||||
when: ansible_facts['distribution'] == 'Archlinux'
|
||||
block:
|
||||
- name: Clone nerd-fonts-fira-code (Archlinux)
|
||||
git:
|
||||
repo: https://aur.archlinux.org/nerd-fonts-fira-code.git
|
||||
dest: ~/builds/nerd-fonts-fira-code
|
||||
clone: true
|
||||
update: false
|
||||
version: master
|
||||
- name: Make and install nerd-fonts-fira-code (Archlinux)
|
||||
command:
|
||||
cmd: makepkg -cirs --needed
|
||||
chdir: ~/builds/nerd-fonts-fira-code
|
||||
stdin: Y
|
||||
register: result
|
||||
changed_when: "'installing existing package' not in result.stderr"
|
||||
notify: Reload font cache
|
||||
|
||||
- name: Install Nerd Fonts patch of FiraCode (Debian)
|
||||
when: ansible_facts['distribution'] == 'Debian'
|
||||
block:
|
||||
- name: Create local fonts directory
|
||||
file:
|
||||
path: ~/.local/share/fonts
|
||||
state: directory
|
||||
mode: 0755
|
||||
- name: Find latest nerdfonts version
|
||||
uri:
|
||||
url: https://github.com/ryanoasis/nerd-fonts/releases/latest
|
||||
register: latest_http_content
|
||||
- name: Set latest nerdfonts version
|
||||
set_fact:
|
||||
nerdfonts_version: "{{ latest_http_content.url | split('/') | last }}"
|
||||
- name: Get latest Nerd Fonts FiraCode zipfile
|
||||
unarchive:
|
||||
src: "https://github.com/ryanoasis/nerd-fonts/releases/download/{{ nerdfonts_version }}/FiraCode.zip"
|
||||
remote_src: true
|
||||
dest: ~/.local/share/fonts/
|
||||
mode: 0644
|
||||
notify: Reload font cache
|
||||
|
||||
- name: Copy terminator config
|
||||
copy: src={{ item.src }} dest={{ item.dest }} mode=0644
|
||||
with_items:
|
||||
|
|
Loading…
Add table
Reference in a new issue