From d73b05a364e3ba34617d2ee1725f978d298e2225 Mon Sep 17 00:00:00 2001 From: L3D Date: Tue, 6 Aug 2024 15:37:31 +0200 Subject: [PATCH] Improve wayland screenshare support with pipewire --- tasks/pipewire.yml | 11 +++++++++++ templates/50-systemd-user.conf.j2 | 9 +++++++++ vars/main.yml | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 templates/50-systemd-user.conf.j2 diff --git a/tasks/pipewire.yml b/tasks/pipewire.yml index 34c552a..69e7035 100644 --- a/tasks/pipewire.yml +++ b/tasks/pipewire.yml @@ -8,5 +8,16 @@ with_items: - 'xdg-desktop-portal-wlr' - 'xdg-desktop-portal-gtk' + - 'xdg-desktop-portal' - 'slurp' - 'pipewire' + +- name: Deploy waybar weather script + become: true + ansible.builtin.template: + src: 'templates/50-systemd-user.conf.j2' + dest: '/etc/sway/config.d/50-systemd-user.conf' + mode: '0644' + owner: 'root' + group: 'root' + backup: true diff --git a/templates/50-systemd-user.conf.j2 b/templates/50-systemd-user.conf.j2 new file mode 100644 index 0000000..b5fc125 --- /dev/null +++ b/templates/50-systemd-user.conf.j2 @@ -0,0 +1,9 @@ +{{ ansible_managed | comment }} +# import variables into system-user enviroment +# based on the instructions in the sway wiki +# see also https://github.com/swaywm/sway/issues/5732 +# and https://github.com/systemd/systemd/blob/dfc637d0ff756889e8e5b7cb4ec991eb06069aa1/xorg/50-systemd-user.sh + +exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP +exec hash dbus-update-activation-environment 2>/dev/null && \ + dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP XDG_CURRENT_DESKTOP=sway diff --git a/vars/main.yml b/vars/main.yml index df72282..50a5beb 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,3 +1,3 @@ --- -playbook_version_number: 11 # should be int +playbook_version_number: 12 # should be int playbook_version_path: 'role-roles-ansible.sway.version'