Files
mw-pfeddersheim-workstation/ansible/roles/hyprland/tasks/main.yml
T
jaandJunie fe7f133136 feat(hyprland): migrate config from .conf to .lua format (Hyprland 0.55+)
- Add hyprland.lua.j2 Ansible template with full Lua DSL config
- Update tasks to deploy hyprland.lua instead of hyprland.conf
- Add docs/tech/hyprland-lua-migration.md with API reference,
  dispatcher mapping, pitfalls, and validation commands
- Update keybindings doc to reflect .lua config format

Co-authored-by: Junie <junie@jetbrains.com>
2026-06-15 06:43:23 +02:00

118 lines
3.7 KiB
YAML

---
- name: Hyprland - install packages
community.general.pacman:
name: "{{ hyprland_packages }}"
state: present
update_cache: yes
tags: [hyprland, packages]
- name: Hyprland - remove X11 packages (Wayland-only)
community.general.pacman:
name: "{{ hyprland_packages_remove }}"
state: absent
tags: [hyprland, packages]
- name: Hyprland - ensure configuration directories exist
file:
path: "/home/{{ system_user }}/.config/{{ item }}"
state: directory
owner: "{{ system_user }}"
group: "{{ system_user }}"
mode: '0755'
loop:
- hypr
- waybar
- hyprlauncher
- dunst
tags: [hyprland, config]
- name: Hyprland - ensure Waybar scripts directory exists
file:
path: "/home/{{ system_user }}/.config/waybar/scripts"
state: directory
owner: "{{ system_user }}"
group: "{{ system_user }}"
mode: '0755'
tags: [hyprland, config]
- name: Hyprland - configure NVIDIA DRM KMS (modeset=1)
lineinfile:
path: /etc/modprobe.d/nvidia.conf
line: "options nvidia-drm modeset=1"
create: yes
notify: rebuild initramfs
tags: [hyprland, nvidia]
- name: Hyprland - check if NVIDIA modules are already in mkinitcpio
command: grep -q "nvidia nvidia_modeset nvidia_uvm nvidia_drm" /etc/mkinitcpio.conf
register: mkinitcpio_check
failed_when: false
changed_when: false
tags: [hyprland, nvidia]
- name: Hyprland - configure early module loading in mkinitcpio
replace:
path: /etc/mkinitcpio.conf
regexp: '^MODULES=\((.*)\)'
replace: 'MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm \1)'
when: mkinitcpio_check.rc != 0
notify: rebuild initramfs
tags: [hyprland, nvidia]
- name: Hyprland - override Wayland session desktop entry (local user)
# Overrides /usr/share/wayland-sessions/hyprland.desktop with start-hyprland
# as the Exec target. This ensures Hyprland is launched through the watchdog
# binary (start-hyprland) for proper crash diagnostics and signal handling.
# XDG_DATA_DIRS priority: ~/.local/share > /usr/share.
# See: docs/adr/0004-start-hyprland-override.md
copy:
dest: /home/{{ system_user }}/.local/share/wayland-sessions/hyprland.desktop
owner: "{{ system_user }}"
group: "{{ system_user }}"
mode: '0644'
content: |
[Desktop Entry]
Name=Hyprland
Comment=An intelligent dynamic tiling Wayland compositor
Exec=start-hyprland
TryExec=start-hyprland
Type=Application
DesktopNames=Hyprland
tags: [hyprland, session]
- name: Hyprland - template core configuration
template:
src: "{{ item.src }}"
dest: "/home/{{ system_user }}/.config/{{ item.dest }}"
owner: "{{ system_user }}"
group: "{{ system_user }}"
mode: '0644'
loop:
- { src: 'hyprland.lua.j2', dest: 'hypr/hyprland.lua' }
- { src: 'hyprlock.conf.j2', dest: 'hypr/hyprlock.conf' }
- { src: 'hypridle.conf.j2', dest: 'hypr/hypridle.conf' }
- { src: 'hyprpaper.conf.j2', dest: 'hypr/hyprpaper.conf' }
- { src: 'waybar_config.j2', dest: 'waybar/config' }
- { src: 'waybar_style.css.j2', dest: 'waybar/style.css' }
- { src: 'hyprlauncher.conf.j2', dest: 'hypr/hyprlauncher.conf' }
- { src: 'dunstrc.j2', dest: 'dunst/dunstrc' }
tags: [hyprland, config]
- name: Hyprland - deploy Waybar GPU monitoring script
template:
src: 'waybar_gpu_script.sh.j2'
dest: "/home/{{ system_user }}/.config/waybar/scripts/gpu.sh"
owner: "{{ system_user }}"
group: "{{ system_user }}"
mode: '0755'
tags: [hyprland, config]
- name: Hyprland - deploy Waybar USB automount script
template:
src: 'waybar_usb_script.sh.j2'
dest: "/home/{{ system_user }}/.config/waybar/scripts/usb.sh"
owner: "{{ system_user }}"
group: "{{ system_user }}"
mode: '0755'
tags: [hyprland, config]