From f2232d636bae4eed0dbdda8e2314b91a489d4878 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Sun, 18 Jan 2026 21:46:58 +0100 Subject: Fix font role --- configure.yml | 4 +-- molecule/archlinux-gnome/converge.yml | 2 +- molecule/archlinux/converge.yml | 2 +- molecule/debian/converge.yml | 2 +- molecule/raspberrypi/converge.yml | 2 +- molecule/ubuntu/converge.yml | 2 +- roles/font/meta/argument_specs.yml | 6 ++++ roles/font/meta/main.yml | 17 +++++++++ roles/font/tasks/main.yml | 52 +++++++++++++++++++++++++++ roles/font/templates/local.conf.j2 | 68 +++++++++++++++++++++++++++++++++++ roles/font/vars/archlinux.yml | 8 +++++ roles/font/vars/debian.yml | 8 +++++ roles/fonts/meta/argument_specs.yml | 6 ---- roles/fonts/meta/main.yml | 17 --------- roles/fonts/tasks/main.yml | 52 --------------------------- roles/fonts/templates/local.conf.j2 | 68 ----------------------------------- roles/fonts/vars/archlinux.yml | 8 ----- roles/fonts/vars/debian.yml | 8 ----- roles/hyprtheme/meta/main.yml | 2 +- roles/waybar/meta/main.yml | 2 +- 20 files changed, 168 insertions(+), 168 deletions(-) create mode 100644 roles/font/meta/argument_specs.yml create mode 100644 roles/font/meta/main.yml create mode 100644 roles/font/tasks/main.yml create mode 100644 roles/font/templates/local.conf.j2 create mode 100644 roles/font/vars/archlinux.yml create mode 100644 roles/font/vars/debian.yml delete mode 100644 roles/fonts/meta/argument_specs.yml delete mode 100644 roles/fonts/meta/main.yml delete mode 100644 roles/fonts/tasks/main.yml delete mode 100644 roles/fonts/templates/local.conf.j2 delete mode 100644 roles/fonts/vars/archlinux.yml delete mode 100644 roles/fonts/vars/debian.yml diff --git a/configure.yml b/configure.yml index 972da8ac..0f1e77aa 100644 --- a/configure.yml +++ b/configure.yml @@ -8,7 +8,7 @@ roles: - role: "locales" - role: "timezone" - - role: "fonts" + - role: "font" - role: "which" - role: "bash" - role: "man" @@ -42,7 +42,7 @@ roles: - role: "locales" - role: "timezone" - - role: "fonts" + - role: "font" - role: "bash" - role: "man" - role: "jq" diff --git a/molecule/archlinux-gnome/converge.yml b/molecule/archlinux-gnome/converge.yml index 3fb3b473..eb71ee38 100644 --- a/molecule/archlinux-gnome/converge.yml +++ b/molecule/archlinux-gnome/converge.yml @@ -74,7 +74,7 @@ - role: "password_store" - role: "which" - role: "firefox" - - role: "fonts" + - role: "font" - role: "alacritty" - role: "btop" - role: "bluetui" diff --git a/molecule/archlinux/converge.yml b/molecule/archlinux/converge.yml index 61d57f12..bc5a1bd9 100644 --- a/molecule/archlinux/converge.yml +++ b/molecule/archlinux/converge.yml @@ -73,7 +73,7 @@ - role: "password_store" - role: "which" - role: "firefox" - - role: "fonts" + - role: "font" - role: "alacritty" - role: "btop" - role: "bluetui" diff --git a/molecule/debian/converge.yml b/molecule/debian/converge.yml index 8789b33b..222b3ba9 100644 --- a/molecule/debian/converge.yml +++ b/molecule/debian/converge.yml @@ -84,7 +84,7 @@ - role: "password_store" - role: "which" - role: "firefox" - - role: "fonts" + - role: "font" - role: "alacritty" - role: "btop" - role: "wlctl" diff --git a/molecule/raspberrypi/converge.yml b/molecule/raspberrypi/converge.yml index 7fe92c71..117cda83 100644 --- a/molecule/raspberrypi/converge.yml +++ b/molecule/raspberrypi/converge.yml @@ -81,7 +81,7 @@ - role: "password_store" - role: "which" - role: "firefox" - - role: "fonts" + - role: "font" - role: "alacritty" - role: "btop" - role: "wlctl" diff --git a/molecule/ubuntu/converge.yml b/molecule/ubuntu/converge.yml index 21a73f6d..ce890bde 100644 --- a/molecule/ubuntu/converge.yml +++ b/molecule/ubuntu/converge.yml @@ -73,7 +73,7 @@ - role: "password_store" - role: "which" - role: "firefox" - - role: "fonts" + - role: "font" - role: "alacritty" - role: "btop" - role: "wlctl" diff --git a/roles/font/meta/argument_specs.yml b/roles/font/meta/argument_specs.yml new file mode 100644 index 00000000..d44dc8c8 --- /dev/null +++ b/roles/font/meta/argument_specs.yml @@ -0,0 +1,6 @@ +--- +argument_specs: + main: + short_description: "Install fonts on Linux distributions" + description: "Install fonts on Linux distributions" + options: {} diff --git a/roles/font/meta/main.yml b/roles/font/meta/main.yml new file mode 100644 index 00000000..b1706f98 --- /dev/null +++ b/roles/font/meta/main.yml @@ -0,0 +1,17 @@ +--- +dependencies: [] +galaxy_info: + author: "a14m" + description: "Install fonts on linux distros." + license: "MIT" + min_ansible_version: "2.18" + platforms: + - name: "ArchLinux" + versions: + - "all" + - name: "Ubuntu" + versions: + - "noble" + - name: "Debian" + versions: + - "bookworm" diff --git a/roles/font/tasks/main.yml b/roles/font/tasks/main.yml new file mode 100644 index 00000000..4e1da0ae --- /dev/null +++ b/roles/font/tasks/main.yml @@ -0,0 +1,52 @@ +--- +- name: "Include OS-specific variables" + ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" + +- name: "Ensure fontconfig is installed" + become: true + ansible.builtin.package: + name: "fontconfig" + state: "present" + +- name: "Ensure fonts are installed" + become: true + ansible.builtin.package: + name: "{{ item }}" + state: "present" + loop: "{{ font_packages }}" + +- name: "Ensure fontconfig global directory exists" + become: true + ansible.builtin.file: + path: "{{ item }}" + state: "directory" + mode: "0755" + loop: + - "/etc/fonts" + - "/etc/fonts/conf.d" + +- name: "Add global font configurations" + become: true + ansible.builtin.template: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + mode: "0644" + loop: + - src: "local.conf.j2" + dest: "/etc/fonts/local.conf" + +- name: "Configure fonts presets" + become: true + ansible.builtin.file: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + state: "link" + loop: + - src: "/usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf" + dest: "/etc/fonts/conf.d/10-sub-pixel-rgb.conf" + - src: "/usr/share/fontconfig/conf.avail/10-hinting-slight.conf" + dest: "/etc/fonts/conf.d/10-hinting-slight.conf" + - src: "/usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf" + dest: "/etc/fonts/conf.d/11-lcdfilter-default.conf" + - src: "/usr/share/fontconfig/conf.avail/70-no-bitmaps-except-emoji.conf" + dest: "/etc/fonts/conf.d/70-no-bitmaps-except-emoji.conf" diff --git a/roles/font/templates/local.conf.j2 b/roles/font/templates/local.conf.j2 new file mode 100644 index 00000000..33574afe --- /dev/null +++ b/roles/font/templates/local.conf.j2 @@ -0,0 +1,68 @@ + + + + + + + true + + + true + + + rgb + + + hintslight + + + lcddefault + + + + + + + serif + + Noto Serif + FreeSerif + Noto Emoji + + + + sans-serif + + Noto Sans + FreeSans + Noto Emoji + + + + sans + + Noto Sans + FreeSans + Noto Color Emoji + Noto Emoji + + + + monospace + + JetBrainsMono + Noto Mono + Noto Color Emoji + Noto Emoji + + + + mono + + JetBrainsMono + Noto Mono + Noto Color Emoji + Noto Emoji + + + diff --git a/roles/font/vars/archlinux.yml b/roles/font/vars/archlinux.yml new file mode 100644 index 00000000..08ff03f0 --- /dev/null +++ b/roles/font/vars/archlinux.yml @@ -0,0 +1,8 @@ +--- +font_packages: + - "ttf-jetbrains-mono-nerd" + - "gnu-free-fonts" + - "noto-fonts" + - "noto-fonts-cjk" + - "noto-fonts-emoji" + - "noto-fonts-extra" diff --git a/roles/font/vars/debian.yml b/roles/font/vars/debian.yml new file mode 100644 index 00000000..fad50d6a --- /dev/null +++ b/roles/font/vars/debian.yml @@ -0,0 +1,8 @@ +--- +font_packages: + - "fonts-jetbrains-mono" + - "fonts-recommended" + - "fonts-noto" + - "fonts-noto-cjk" + - "fonts-noto-emoji" + - "fonts-noto-extra" diff --git a/roles/fonts/meta/argument_specs.yml b/roles/fonts/meta/argument_specs.yml deleted file mode 100644 index d44dc8c8..00000000 --- a/roles/fonts/meta/argument_specs.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -argument_specs: - main: - short_description: "Install fonts on Linux distributions" - description: "Install fonts on Linux distributions" - options: {} diff --git a/roles/fonts/meta/main.yml b/roles/fonts/meta/main.yml deleted file mode 100644 index b1706f98..00000000 --- a/roles/fonts/meta/main.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -dependencies: [] -galaxy_info: - author: "a14m" - description: "Install fonts on linux distros." - license: "MIT" - min_ansible_version: "2.18" - platforms: - - name: "ArchLinux" - versions: - - "all" - - name: "Ubuntu" - versions: - - "noble" - - name: "Debian" - versions: - - "bookworm" diff --git a/roles/fonts/tasks/main.yml b/roles/fonts/tasks/main.yml deleted file mode 100644 index 74d3480e..00000000 --- a/roles/fonts/tasks/main.yml +++ /dev/null @@ -1,52 +0,0 @@ ---- -- name: "Include OS-specific variables" - ansible.builtin.include_vars: "{{ ansible_os_family | lower }}.yml" - -- name: "Ensure fontconfig is installed" - become: true - ansible.builtin.package: - name: "fontconfig" - state: "present" - -- name: "Ensure fonts are installed" - become: true - ansible.builtin.package: - name: "{{ item }}" - state: "present" - loop: "{{ fonts }}" - -- name: "Ensure fontconfig global directory exists" - become: true - ansible.builtin.file: - path: "{{ item }}" - state: "directory" - mode: "0755" - loop: - - "/etc/fonts" - - "/etc/fonts/conf.d" - -- name: "Add global font configurations" - become: true - ansible.builtin.template: - src: "{{ item.src }}" - dest: "{{ item.dest }}" - mode: "0644" - loop: - - src: "local.conf.j2" - dest: "/etc/fonts/local.conf" - -- name: "Configure fonts presets" - become: true - ansible.builtin.file: - src: "{{ item.src }}" - dest: "{{ item.dest }}" - state: "link" - loop: - - src: "/usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf" - dest: "/etc/fonts/conf.d/10-sub-pixel-rgb.conf" - - src: "/usr/share/fontconfig/conf.avail/10-hinting-slight.conf" - dest: "/etc/fonts/conf.d/10-hinting-slight.conf" - - src: "/usr/share/fontconfig/conf.avail/11-lcdfilter-default.conf" - dest: "/etc/fonts/conf.d/11-lcdfilter-default.conf" - - src: "/usr/share/fontconfig/conf.avail/70-no-bitmaps-except-emoji.conf" - dest: "/etc/fonts/conf.d/70-no-bitmaps-except-emoji.conf" diff --git a/roles/fonts/templates/local.conf.j2 b/roles/fonts/templates/local.conf.j2 deleted file mode 100644 index 33574afe..00000000 --- a/roles/fonts/templates/local.conf.j2 +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - - true - - - true - - - rgb - - - hintslight - - - lcddefault - - - - - - - serif - - Noto Serif - FreeSerif - Noto Emoji - - - - sans-serif - - Noto Sans - FreeSans - Noto Emoji - - - - sans - - Noto Sans - FreeSans - Noto Color Emoji - Noto Emoji - - - - monospace - - JetBrainsMono - Noto Mono - Noto Color Emoji - Noto Emoji - - - - mono - - JetBrainsMono - Noto Mono - Noto Color Emoji - Noto Emoji - - - diff --git a/roles/fonts/vars/archlinux.yml b/roles/fonts/vars/archlinux.yml deleted file mode 100644 index 5ee5cedf..00000000 --- a/roles/fonts/vars/archlinux.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -fonts: - - "ttf-jetbrains-mono-nerd" - - "gnu-free-fonts" - - "noto-fonts" - - "noto-fonts-cjk" - - "noto-fonts-emoji" - - "noto-fonts-extra" diff --git a/roles/fonts/vars/debian.yml b/roles/fonts/vars/debian.yml deleted file mode 100644 index d0568a1e..00000000 --- a/roles/fonts/vars/debian.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -fonts: - - "fonts-jetbrains-mono" - - "gnu-free-fonts" - - "noto-fonts" - - "noto-fonts-cjk" - - "noto-fonts-emoji" - - "noto-fonts-extra" diff --git a/roles/hyprtheme/meta/main.yml b/roles/hyprtheme/meta/main.yml index b0a348b6..126d1751 100644 --- a/roles/hyprtheme/meta/main.yml +++ b/roles/hyprtheme/meta/main.yml @@ -1,6 +1,6 @@ --- dependencies: - - role: "fonts" + - role: "font" galaxy_info: author: "a14m" description: "Install hyprland themes" diff --git a/roles/waybar/meta/main.yml b/roles/waybar/meta/main.yml index a17e7049..3a9129ab 100644 --- a/roles/waybar/meta/main.yml +++ b/roles/waybar/meta/main.yml @@ -1,6 +1,6 @@ --- dependencies: - - role: "fonts" + - role: "font" - role: "alacritty" - role: "btop" - role: "bluetui" -- cgit v1.2.3