2021-06-16 22:57:18 +02:00
|
|
|
# Xorg configuration
|
|
|
|
|
|
|
|
- name: Check if there is Intel backlight
|
2023-11-02 19:51:54 +01:00
|
|
|
ansible.builtin.stat:
|
2021-06-16 22:57:18 +02:00
|
|
|
path: /sys/class/backlight/intel_backlight
|
|
|
|
register: intel_backlight
|
2021-06-18 21:53:42 +02:00
|
|
|
when: display_server == 'x11'
|
2021-06-16 22:57:18 +02:00
|
|
|
|
|
|
|
- name: Install Intel video drivers (Arch based)
|
2023-11-02 19:51:54 +01:00
|
|
|
community.general.pacman:
|
2021-06-16 22:57:18 +02:00
|
|
|
name: xf86-video-intel
|
|
|
|
# state: "{{ intel_backlight.stat.exists }}"
|
|
|
|
state: present
|
2023-11-02 19:51:54 +01:00
|
|
|
become: true
|
2021-06-18 21:53:42 +02:00
|
|
|
when: display_server == 'x11' and intel_backlight.stat.exists and arch_based
|
2021-06-19 16:52:28 +02:00
|
|
|
# TODO With software role? Would permit other distributions
|
2021-06-16 22:57:18 +02:00
|
|
|
|
|
|
|
- name: Configure Xorg Intel backlight
|
2023-11-02 19:51:54 +01:00
|
|
|
ansible.builtin.copy:
|
2021-06-16 22:57:18 +02:00
|
|
|
src: xorg/intel_backlight.conf
|
|
|
|
dest: "{{ item }}/20-intel_backlight.conf"
|
2023-11-02 19:51:54 +01:00
|
|
|
become: true
|
2021-06-18 21:53:42 +02:00
|
|
|
when: display_server == 'x11' and intel_backlight.stat.exists
|
2021-06-16 22:57:18 +02:00
|
|
|
loop: "{{ xorg_common_config_dirs }}"
|
|
|
|
|
|
|
|
- name: Configure Xorg joystick behaviour
|
2023-11-02 19:51:54 +01:00
|
|
|
ansible.builtin.copy:
|
2021-06-16 22:57:18 +02:00
|
|
|
src: xorg/joystick.conf
|
|
|
|
dest: "{{ item }}/50-joystick.conf"
|
2023-11-02 19:51:54 +01:00
|
|
|
become: true
|
2021-06-18 21:53:42 +02:00
|
|
|
when: display_server == 'x11'
|
2021-06-16 22:57:18 +02:00
|
|
|
loop: "{{ xorg_common_config_dirs }}"
|
|
|
|
|
2021-06-21 22:01:48 +02:00
|
|
|
- name: List modules we're using
|
2023-11-02 19:51:54 +01:00
|
|
|
ansible.builtin.slurp:
|
2021-06-21 22:01:48 +02:00
|
|
|
src: /proc/modules
|
2023-11-02 19:51:54 +01:00
|
|
|
register: modules
|
2021-06-21 22:01:48 +02:00
|
|
|
when: display_server
|
|
|
|
# Not sure the module will be loaded in early setup stages though
|
|
|
|
|
|
|
|
- name: Make panfrost use OpenGL 3.3
|
2023-11-02 19:51:54 +01:00
|
|
|
ansible.builtin.lineinfile:
|
2021-06-21 22:01:48 +02:00
|
|
|
path: /etc/environment
|
2023-11-02 19:51:54 +01:00
|
|
|
line: PAN_MESA_DEBUG="gl3"
|
|
|
|
regexp: ^#? ?PAN_MESA_DEBUG=
|
|
|
|
become: true
|
2021-06-21 22:01:48 +02:00
|
|
|
when: display_server and using_panfrost
|
|
|
|
vars:
|
|
|
|
using_panfrost: "{{ 'panfrost' in (modules.content | b64decode) }}"
|
|
|
|
notify: panfrost config changed
|
|
|
|
|
2021-06-16 22:57:18 +02:00
|
|
|
# Numlock on boot
|
|
|
|
|
2023-11-02 19:51:54 +01:00
|
|
|
- name: Set numlock on boot
|
|
|
|
ansible.builtin.copy:
|
2021-06-16 22:57:18 +02:00
|
|
|
src: getty.service
|
|
|
|
dest: /etc/systemd/system/getty@.service.d/override.conf
|
2023-11-02 19:51:54 +01:00
|
|
|
become: true
|
2021-06-16 22:57:18 +02:00
|
|
|
notify:
|
|
|
|
- systemd changed
|
|
|
|
when: auto_numlock
|
|
|
|
|
|
|
|
- name: Unset numlock on boot
|
2023-11-02 19:51:54 +01:00
|
|
|
ansible.builtin.file:
|
2021-06-16 22:57:18 +02:00
|
|
|
path: /etc/systemd/system/getty@.service.d/override.conf
|
|
|
|
state: absent
|
2023-11-02 19:51:54 +01:00
|
|
|
become: true
|
2021-06-16 22:57:18 +02:00
|
|
|
notify:
|
|
|
|
- systemd changed
|
|
|
|
when: not auto_numlock
|