diff options
| -rw-r--r-- | roles/hyprland/meta/main.yml | 1 | ||||
| -rw-r--r-- | roles/hyprland/tasks/main.yml | 15 | ||||
| -rw-r--r-- | roles/hyprshare/defaults/main.yml | 2 | ||||
| -rw-r--r-- | roles/hyprshare/handlers/main.yml | 6 | ||||
| -rw-r--r-- | roles/hyprshare/meta/main.yml | 3 | ||||
| -rw-r--r-- | roles/hyprshare/tasks/main.yml | 8 | ||||
| -rw-r--r-- | roles/hyprshare/templates/xdph.conf.j2 (renamed from roles/hyprland/templates/hypr/xdph.conf.j2) | 2 | ||||
| -rw-r--r-- | roles/xdg-desktop-portal/meta/argument_specs.yml | 4 | ||||
| -rw-r--r-- | roles/xdg-desktop-portal/meta/main.yml | 17 | ||||
| -rw-r--r-- | roles/xdg-desktop-portal/tasks/main.yml | 8 |
10 files changed, 50 insertions, 16 deletions
diff --git a/roles/hyprland/meta/main.yml b/roles/hyprland/meta/main.yml index 0e580298..b1837c7d 100644 --- a/roles/hyprland/meta/main.yml +++ b/roles/hyprland/meta/main.yml @@ -17,6 +17,7 @@ dependencies: - role: "waybar" - role: "clipse" - role: "tofi" + - role: "xdg-desktop-portal" - role: "hyprcursor" - role: "hyprtheme" - role: "hyprshare" diff --git a/roles/hyprland/tasks/main.yml b/roles/hyprland/tasks/main.yml index c0135a4e..e5e16b00 100644 --- a/roles/hyprland/tasks/main.yml +++ b/roles/hyprland/tasks/main.yml @@ -10,8 +10,6 @@ - "hyprsunset" - "hyprshot" - "hyprland" - - "xdg-desktop-portal-gnome" - - "xdg-desktop-portal-hyprland" state: "present" - name: "Ensure hyprland AUR packages are installed" @@ -76,8 +74,6 @@ dest: "/etc/hypr/hyprlock.conf" - src: "hypr/hypridle.conf.j2" dest: "/etc/hypr/hypridle.conf" - - src: "hypr/xdph.conf.j2" - dest: "/etc/hypr/xdph.conf" - src: "hypr/hyprland.conf.j2" dest: "/etc/hypr/hyprland.conf" - src: "uwsm/env.j2" @@ -111,17 +107,6 @@ # System defaults source = /etc/hypr/hypridle.conf - - name: "Configure user xdg-desktop-portal-hyprland" - ansible.builtin.blockinfile: - path: "{{ ansible_facts['env']['HOME'] }}/.config/hypr/xdph.conf" - state: "present" - prepend_newline: true - append_newline: true - marker: "# ==== {mark} ANSIBLE HYPRSHARE CONFIG" - block: | - # System defaults - source = /etc/hypr/xdph.conf - - name: "Copy hyprland scripts" become: true ansible.builtin.copy: diff --git a/roles/hyprshare/defaults/main.yml b/roles/hyprshare/defaults/main.yml new file mode 100644 index 00000000..69603a29 --- /dev/null +++ b/roles/hyprshare/defaults/main.yml @@ -0,0 +1,2 @@ +--- +hyprshare_install_preview: false diff --git a/roles/hyprshare/handlers/main.yml b/roles/hyprshare/handlers/main.yml new file mode 100644 index 00000000..d77a519b --- /dev/null +++ b/roles/hyprshare/handlers/main.yml @@ -0,0 +1,6 @@ +--- +- name: "Restart xdg-desktop-portal-hyprland" + ansible.builtin.systemd_service: + name: "xdg-desktop-portal-hyprland" + state: "restarted" + scope: "user" diff --git a/roles/hyprshare/meta/main.yml b/roles/hyprshare/meta/main.yml index 2a1224b7..ac6ff156 100644 --- a/roles/hyprshare/meta/main.yml +++ b/roles/hyprshare/meta/main.yml @@ -1,5 +1,6 @@ --- -dependencies: [] +dependencies: + - role: "xdg-desktop-portal" galaxy_info: author: "a14m" description: "Install Hyprland screensharing dependencies" diff --git a/roles/hyprshare/tasks/main.yml b/roles/hyprshare/tasks/main.yml index 8fd53138..68d318ae 100644 --- a/roles/hyprshare/tasks/main.yml +++ b/roles/hyprshare/tasks/main.yml @@ -14,6 +14,7 @@ name: "hyprland-preview-share-picker" state: "present" use: "yay" + when: hyprshare_install_preview # This is a workaround the installation failing # because the log file is created with aur_builder as an owner @@ -22,4 +23,11 @@ ansible.builtin.file: path: "/tmp/hyprland-preview-share-picker.log" state: "absent" + when: hyprshare_install_preview +- name: "Template user share picker configuration" + ansible.builtin.template: + src: "xdph.conf.j2" + dest: "{{ ansible_facts['env']['HOME'] }}/.config/hypr/xdph.conf" + mode: "0644" + notify: "Restart xdg-desktop-portal-hyprland" diff --git a/roles/hyprland/templates/hypr/xdph.conf.j2 b/roles/hyprshare/templates/xdph.conf.j2 index 0e4b8119..317d27f7 100644 --- a/roles/hyprland/templates/hypr/xdph.conf.j2 +++ b/roles/hyprshare/templates/xdph.conf.j2 @@ -1,5 +1,7 @@ screencopy { max_fps = 60 allow_token_by_default = true +{% if hyprshare_install_preview %} custom_picker_binary = hyprland-preview-share-picker +{% endif %} } diff --git a/roles/xdg-desktop-portal/meta/argument_specs.yml b/roles/xdg-desktop-portal/meta/argument_specs.yml new file mode 100644 index 00000000..5af49897 --- /dev/null +++ b/roles/xdg-desktop-portal/meta/argument_specs.yml @@ -0,0 +1,4 @@ +--- +argument_specs: + main: + options: {} diff --git a/roles/xdg-desktop-portal/meta/main.yml b/roles/xdg-desktop-portal/meta/main.yml new file mode 100644 index 00000000..f79b268a --- /dev/null +++ b/roles/xdg-desktop-portal/meta/main.yml @@ -0,0 +1,17 @@ +--- +dependencies: [] +galaxy_info: + author: "a14m" + description: "Install xdg-desktop-portal" + license: "MIT" + min_ansible_version: "2.18" + platforms: + - name: "ArchLinux" + versions: + - "all" + - name: "Ubuntu" + versions: + - "noble" + - name: "Debian" + versions: + - "bookworm" diff --git a/roles/xdg-desktop-portal/tasks/main.yml b/roles/xdg-desktop-portal/tasks/main.yml new file mode 100644 index 00000000..95fca9ff --- /dev/null +++ b/roles/xdg-desktop-portal/tasks/main.yml @@ -0,0 +1,8 @@ +--- +- name: "Ensure xdg-desktop-portal packages are installed" + become: true + ansible.builtin.package: + name: + - "xdg-desktop-portal-gnome" + - "xdg-desktop-portal-hyprland" + state: "present" |
