Add Hyprland Void desktop profile

This commit is contained in:
Fabio Scotto di Santolo
2026-06-06 16:08:35 +02:00
parent 3460c2a9cb
commit 769e61a488
26 changed files with 746 additions and 17 deletions

View File

@@ -5,9 +5,9 @@
path: /etc/xbps.d
state: directory
mode: "0755"
when: (host_xbps_repositories | default([])) | length > 0
when: (void_xbps_repositories | default([]) + host_xbps_repositories | default([])) | length > 0
- name: Configure host-specific XBPS repositories
- name: Configure Void XBPS repositories
tags: [packages]
ansible.builtin.copy:
dest: "/etc/xbps.d/{{ item.name }}.conf"
@@ -16,11 +16,11 @@
owner: root
group: root
mode: "0644"
loop: "{{ host_xbps_repositories | default([]) }}"
loop: "{{ void_xbps_repositories | default([]) + host_xbps_repositories | default([]) }}"
loop_control:
label: "{{ item.name }}"
register: host_xbps_repository_configs
when: (host_xbps_repositories | default([])) | length > 0
register: void_xbps_repository_configs
when: (void_xbps_repositories | default([]) + host_xbps_repositories | default([])) | length > 0
- name: Install Void nonfree repository if needed
tags: [packages]
@@ -37,7 +37,7 @@
update_cache: true
accept_pubkey: true
when: >-
(host_xbps_repositories | default([])) | length > 0
(void_xbps_repositories | default([]) + host_xbps_repositories | default([])) | length > 0
or (void_nonfree_repository is defined and void_nonfree_repository is changed)
- name: Synchronize and upgrade Void Linux packages
@@ -66,6 +66,11 @@
if 'sway' in (desktop_sessions_enabled | default([]))
else []
)
+ (
(desktop_hyprland_packages | default([]))
if 'hyprland' in (desktop_sessions_enabled | default([]))
else []
)
+ (host_packages | default([]))
)
| unique

View File

@@ -34,3 +34,18 @@
- "'sway' in (desktop_sessions_enabled | default([]))"
- (host_sway_dotfiles | default([])) | length > 0
- name: Copy host-specific Hyprland dotfiles
tags: [dotfiles, dotfiles:desktop, dotfiles:host, hyprland]
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/{{ hostname }}/{{ item.src }}"
dest: "{{ user_home }}/{{ item.dest }}"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ host_hyprland_dotfiles | default([]) }}"
loop_control:
label: "{{ item.dest }}"
when:
- "'hyprland' in (desktop_sessions_enabled | default([]))"
- (host_hyprland_dotfiles | default([])) | length > 0

View File

@@ -0,0 +1,4 @@
[preferred]
default=gtk
org.freedesktop.impl.portal.Screenshot=hyprland
org.freedesktop.impl.portal.ScreenCast=hyprland

View File

@@ -0,0 +1,6 @@
[Desktop Entry]
Name=Hyprland
Comment=Hyprland (Wayland)
Exec=/usr/local/bin/start-hyprland-session
Type=Application
DesktopNames=Hyprland

View File

@@ -0,0 +1,78 @@
---
- name: Ensure Hyprland config directories exist
tags: [dotfiles, dotfiles:desktop, hyprland]
ansible.builtin.file:
path: "{{ item }}"
state: directory
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "0755"
loop:
- "{{ user_home }}/.config/alacritty"
- "{{ user_home }}/.config/dunst"
- "{{ user_home }}/.config/flameshot"
- "{{ user_home }}/.config/foot"
- "{{ user_home }}/.config/hypr"
- "{{ user_home }}/.config/rofi"
- "{{ user_home }}/.config/waybar"
when: "'hyprland' in (desktop_sessions_enabled | default([]))"
- name: Install allowed emptty Hyprland Wayland session
tags: [packages, services, emptty, hyprland]
ansible.builtin.copy:
src: hyprland.desktop
dest: /etc/emptty/wayland-sessions/hyprland.desktop
owner: root
group: root
mode: "0644"
when: "'hyprland' in (desktop_sessions_enabled | default([]))"
- name: Remove legacy Hyprland session launcher shadowing package binary
tags: [packages, services, hyprland]
ansible.builtin.file:
path: /usr/local/bin/start-hyprland
state: absent
when: "'hyprland' in (desktop_sessions_enabled | default([]))"
- name: Install Hyprland session launcher in /usr/local/bin
tags: [packages, services, hyprland]
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/desktop/.local/bin/start-hyprland-session"
dest: /usr/local/bin/start-hyprland-session
owner: root
group: root
mode: "0755"
when: "'hyprland' in (desktop_sessions_enabled | default([]))"
- name: Ensure /etc/xdg/xdg-desktop-portal exists for Hyprland
tags: [packages, services, hyprland, portal]
ansible.builtin.file:
path: /etc/xdg/xdg-desktop-portal
state: directory
owner: root
group: root
mode: "0755"
when: "'hyprland' in (desktop_sessions_enabled | default([]))"
- name: Configure xdg-desktop-portal backend preferences for Hyprland
tags: [packages, services, hyprland, portal]
ansible.builtin.copy:
src: hyprland-portals.conf
dest: /etc/xdg/xdg-desktop-portal/hyprland-portals.conf
owner: root
group: root
mode: "0644"
when: "'hyprland' in (desktop_sessions_enabled | default([]))"
- name: Copy Hyprland desktop dotfiles
tags: [dotfiles, dotfiles:desktop, hyprland]
ansible.builtin.copy:
src: "{{ playbook_dir }}/../dotfiles/desktop/{{ item.src }}"
dest: "{{ user_home }}/{{ item.dest }}"
owner: "{{ username }}"
group: "{{ user_group }}"
mode: "{{ item.mode }}"
loop: "{{ desktop_hyprland_dotfiles | default([]) }}"
loop_control:
label: "{{ item.dest }}"
when: "'hyprland' in (desktop_sessions_enabled | default([]))"