Skip to content

Instantly share code, notes, and snippets.

@brunoanc
Last active January 28, 2025 02:33
Show Gist options
  • Save brunoanc/2dea6ddf6974ba4e5d26c3139ffb7580 to your computer and use it in GitHub Desktop.
Save brunoanc/2dea6ddf6974ba4e5d26c3139ffb7580 to your computer and use it in GitHub Desktop.
Screen sharing on Hyprland (Arch Linux)

Screen sharing on Hyprland (Arch Linux)

Table of contents

Introduction

This guide will go through the setup and troubleshooting steps required to get screen sharing working on OBS with the Hyprland compositor.

This guide will use the yay AUR helper for AUR package installation, but the commands should be similar for other helpers such as paru.

WARNING: This guide demands that the user has a basic understanding on installing packages (both official and AUR), using git, compiling from source, and some patience.

Install PipeWire and friends

First, we need to install pipewire and wireplumber. To do that, run the following command:

sudo pacman -S pipewire wireplumber

Install xdg-desktop-portal and friends

Option #1: xdg-desktop-portal-hyprland (recommended)

We will install the xdg-desktop-portal-hyprland-git package from the AUR, which provides additional functionality such as window sharing. With an AUR helper such as yay, you can install it this way:

yay -S xdg-desktop-portal-hyprland-git

Option #2: xdg-desktop-portal-wlr (not recommended)

This option provides less options than xdg-desktop-portal-wlr, but it will still allow fullscreen sharing. Install it running the following command:

sudo pacman -S xdg-desktop-portal-wlr

WARNING: The rest of this guide will assume xdg-desktop-portal-hyprland was choosed. If you picked this option, replace any -hyprland mentions for -wlr in the rest of this guide.

Remove other portal implementations

Make sure you don't have any other xdg-desktop-portal-* packages installed (except possibly xdg-desktop-portal-gtk for file dialogs), as this could cause problems later. To check if you have any, run the following command:

pacman -Q | grep xdg-desktop-portal-

then delete all of the listed packages except the -hyprland one we just installed and the -gtk one if you so chose.

Also make sure to install the optional dependencies grim and slurp:

sudo pacman -S grim slurp

Editing the configuration file

Open your Hyprland config file (usually located at ~/.config/hypr/hyprland.conf) with a text editor, and add the following line at the end:

exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

This will make sure that xdg-desktop-portal-hyprland can get the required variables on startup.

Restart your session

Now log out and then log back in, or reboot your system. Once you're back into Hyprland, try sharing in OBS with the "Screen Capture (PipeWire)" option.

If it works, congratulations! You may exit this guide now. If not, follow along:

Troubleshooting PipeWire

Make sure both pipewire and wireplumber are running. Run the following command:

systemctl --user status pipewire wireplumber

This should return "active (running)" for both. If it doesn't, follow the Arch Wiki article for troubleshooting.

Troubleshooting desktop portal

Run the following command to check for errors in xdg-desktop-portal-hyprland:

systemctl --user status xdg-desktop-portal-hyprland

This should return "active (running)". If it doesn't, check the errors it gives you. Here's some workarounds for common errors:

Portal service (wlroots implementation) was skipped because of a failed condition check

Make sure you added the required line to the Hyprland configuration. Check for typos.

unsupported wl_shm format 0x34324742 (after trying to share the screen on NVIDIA)

Install the modified hyprland-nvidia-git AUR package:

yay -S hyprland-nvidia-git

Alternatively, you can modify the source code manually:

We'll need to modify the wlroots submodule source code to make it choose a viable format.

First, clone the Hyprland repo if you haven't already:

git clone --recursive https://github.com/vaxerski/Hyprland

Then, install all required dependencies for building, as specified in the wiki:

sudo pacman -S gdb ninja gcc cmake libxcb xcb-proto xcb-util xcb-util-keysyms libxfixes libx11 libxcomposite xorg-xinput libxrender pixman wayland-protocols cairo pango --needed

Open the wlroots/types/output/render.c file, look for the wlr_output_preferred_read_format, and replace it with the following:

uint32_t wlr_output_preferred_read_format(struct wlr_output *output) {
    return DRM_FORMAT_XRGB8888;
}

Afterwards, compile and install by running sudo make install, then restart your session.

Troubleshooting OBS

You can try the wlrobs-hg plugin.

Troubleshooting your browser

If you're trying to share your screen in your browser, first make sure that it supports Wayland and screen sharing on it, else it will not work.

Firefox

Make sure you're running on Wayland. To do this, go to about:support, look for "Window Protocol", and make sure it is set to "wayland". If it isn't, set the environment variable MOZ_ENABLE_WAYLAND=1 in an environment file, like /etc/environment, /etc/profile, ~/.bash_profile, ~/.zshenv, etc.

If it still doesn't work, open about:config and make sure the media.peerconnection.enabled flag is set to true.

Chromium

To run on Wayland, set the --ozone-platform-hint=auto flag in the chromium flags file (~/.config/chromium-flags.conf for the default package, ~/.config/chrome-flags.conf for Chrome).

Also ensure the "WebRTC PipeWire support" flag is enabled by opening chrome://flags/#enable-webrtc-pipewire-capturer and enabling it.

Troubleshooting your app

Make sure the app you're trying to share the screen with supports Wayland and sharing the screen with it.

Notable programs that still don't have full support for this are Discord and Zoom.

It still doesn't work!

Follow the official xdg-desktop-portal-wlr troubleshooting guide.

If it still doesn't work, consider opening an issue in the xdg-desktop-portal-hyprland repo.

References

@julius-boettger
Copy link

@radholm @CRAG666

I had the same problem today and for me adding bitdepth,10 to the monitor rule in the hyprland config solved it.

monitor=,preferred,auto,auto,bitdepth,10

Not sure if it would work in your cases too, but thought it might help.

This also fixed it for me! Thanks :)

@JcBernack
Copy link

JcBernack commented Nov 12, 2023

@radholm @CRAG666

I had the same problem today and for me adding bitdepth,10 to the monitor rule in the hyprland config solved it.

monitor=,preferred,auto,auto,bitdepth,10

Not sure if it would work in your cases too, but thought it might help.

What the actual.. that's the last thing I would have expected to work. Thanks!

I did not install hyprland-nvidia-git, the only other thing I did was getting the hyprland portal:
xdg-desktop-portal-hyprland-git 1:r326.b2fc111-1

I have only one kind of funny issue remaining:
My left monitor is in portait mode, but the screen share does not reflect that. The content is rotated 90° so everyone needs to tilt their head.

@mamaraddio
Copy link

mamaraddio commented Nov 30, 2023

Do you know of a way to force wrl to be the default for the APIs it implements, and fallback to gtk/gnome for the rest?

You could take a look at man 5 portals.conf to get an example of exactly what you're asking. Set a default portal (gtk) but override specific interfaces with another portal implementation (wlr or even better hyprland)

@iuliandita
Copy link

Thanks for the guide!
With the latest aur package (xdg-desktop-portal-hyprland-git 1:r333.f5c3576-1), the xdg-desktop-portal-hyprland service does not start.

  systemctl --user status xdg-desktop-portal-hyprland
× xdg-desktop-portal-hyprland.service - Portal service (Hyprland implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-hyprland.service; static)
     Active: failed (Result: exit-code) since Tue 2023-12-19 15:01:56 CET; 4min 30s ago
    Process: 213421 ExecStart=/usr/lib/xdg-desktop-portal-hyprland (code=exited, status=127)
   Main PID: 213421 (code=exited, status=127)
        CPU: 1ms

Dec 19 15:01:56 machine systemd[1927]: xdg-desktop-portal-hyprland.service: Scheduled restart job, restart counter is at 5.
Dec 19 15:01:56 machine systemd[1927]: xdg-desktop-portal-hyprland.service: Start request repeated too quickly.
Dec 19 15:01:56 machine systemd[1927]: xdg-desktop-portal-hyprland.service: Failed with result 'exit-code'.
Dec 19 15:01:56 machine systemd[1927]: Failed to start Portal service (Hyprland implementation).
  journalctl --user -xeu xdg-desktop-portal-hyprland.service
Dec 19 08:16:27 machine systemd[1927]: Starting Portal service (Hyprland implementation)...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit UNIT has begun execution.
░░
░░ The job identifier is 172.
Dec 19 08:16:27 machine xdg-desktop-portal-hyprland[2214]: /usr/lib/xdg-desktop-portal-hyprland: error while loading shared libraries: libsdbus-c++.so.1: cannot open shared object file: No such file or directory
Dec 19 08:16:27 machine systemd[1927]: xdg-desktop-portal-hyprland.service: Main process exited, code=exited, status=127/n/a
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStart= process belonging to unit UNIT has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 127.
Dec 19 08:16:27 machine systemd[1927]: xdg-desktop-portal-hyprland.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ The unit UNIT has entered the 'failed' state with result 'exit-code'.
Dec 19 08:16:27 machine systemd[1927]: Failed to start Portal service (Hyprland implementation).
░░ Subject: A start job for unit UNIT has failed
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit UNIT has finished with a failure.
░░
░░ The job identifier is 172 and the job result is failed.
Dec 19 08:16:27 machine systemd[1927]: xdg-desktop-portal-hyprland.service: Scheduled restart job, restart counter is at 1.
░░ Subject: Automatic restarting of a unit has been scheduled
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ Automatic restarting of the unit UNIT has been scheduled, as the result for
░░ the configured Restart= setting for the unit.
Dec 19 08:16:27 machine systemd[1927]: Starting Portal service (Hyprland implementation)...
░░ Subject: A start job for unit UNIT has begun execution
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit UNIT has begun execution.
░░
░░ The job identifier is 216.
Dec 19 08:16:27 machine xdg-desktop-portal-hyprland[2229]: /usr/lib/xdg-desktop-portal-hyprland: error while loading shared libraries: libsdbus-c++.so.1: cannot open shared object file: No such file or directory
Dec 19 08:16:27 machine systemd[1927]: xdg-desktop-portal-hyprland.service: Main process exited, code=exited, status=127/n/a
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ An ExecStart= process belonging to unit UNIT has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 127.

Here's a discussion that pointed me in the right direction. Installing the sdbus-cpp package fixed it for me.

  systemctl --user status xdg-desktop-portal-hyprland
● xdg-desktop-portal-hyprland.service - Portal service (Hyprland implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-hyprland.service; static)
     Active: active (running) since Tue 2023-12-19 15:08:19 CET; 9s ago
   Main PID: 216317 (xdg-desktop-por)
      Tasks: 6 (limit: 18784)
     Memory: 14.4M (peak: 15.0M)
        CPU: 49ms
     CGroup: /user.slice/user-1000.slice/[email protected]/session.slice/xdg-desktop-portal-hyprland.service
             └─216317 /usr/lib/xdg-desktop-portal-hyprland

Dec 19 15:08:19 machine systemd[1927]: Starting Portal service (Hyprland implementation)...
Dec 19 15:08:19 machine systemd[1927]: Started Portal service (Hyprland implementation).

@cpiber
Copy link

cpiber commented Feb 4, 2024

If anyone else has a similar problem that the systemd services etc are all running, check the output of /usr/libexec/xdg-desktop-portal --verbose. In particular, you should see something along the lines of:

XDP: loading /usr/share/xdg-desktop-portal/portals/hyprland.portal
...
XDP: Found 'hyprland' in configuration for default
XDP: Using hyprland.portal for org.freedesktop.impl.portal.ScreenCast (config)
XDP: providing portal org.freedesktop.portal.ScreenCast

If you do not see those, verify that the hyprland.portal file can be found. In particular, if you installed from source, it might be located in /usr/local/share/xdg-desktop-portal/portals/, which is not picked up, so you need to link it to the proper location: sudo ln -s /usr/local/share/xdg-desktop-portal/portals/hyprland.portal /usr/share/xdg-desktop-portal/portals/. After that the portal should be recognized and the implementation should be provided.

@GaNiziolek
Copy link

For those that are having trouble and the xdg-desktop-portal-hyprland service was not starting, I managed to work by installing xdg-desktop-portal-hyprland package with Pacman, instead of xdg-desktop-portal-hyprland-git with yay

@gmankab
Copy link

gmankab commented Feb 15, 2024

@kstepanovdev
Copy link

For those that are having trouble and the xdg-desktop-portal-hyprland service was not starting, I managed to work by installing xdg-desktop-portal-hyprland package with Pacman, instead of xdg-desktop-portal-hyprland-git with yay

It has been useful, thanks.

@atasoglou
Copy link

I am on xdg-desktop-portal-gtk 1.15.1-2 and xdg-desktop-portal-hyprland-git 1.3.1.r22.g91e48d6a-1 and I use a single monitor. For me when trying to share the whole screen it only works sometimes. Most of times I get a black screen. Sharing a specific window always works. Any ideas? Any pointers? Thanks!

@gual
Copy link

gual commented Jun 20, 2024

The content is rotated 90° so everyone needs to tilt their head.

@JcBernack, lol, my issue as well. Did you find a solution?

@JcBernack
Copy link

@gual Unfortunately not. In the meantime I also got rid of the second monitor, so stopped trying to look for a solution.

@robbplo
Copy link

robbplo commented Jun 21, 2024

I am also experiencing a black screen and screen sharing works only sometimes. It does seem to depend on the client, but somehow i've had the most success in chrome on xwayland. I am trying out webcord, with and without xwayland, both of which seem to behave the same. OBS running on wayland works quite consistently.

I've gotten a consistently working stream in webcord, but only when the resolution of the display is in 1080p. I have a 4k display and one 1440p, both show a black screen when sharing, except when running in 1080p.

@Arnau478
Copy link

@gual did you find a solution? I also have the same issue LMAO

@gual
Copy link

gual commented Jun 24, 2024

@Arnau478 No, I went through the issues and found a report last year (hyprwm/xdg-desktop-portal-hyprland#43), which was closed due to a rewrite; I commented there to see if they could point me the right direction.

@PhilT
Copy link

PhilT commented Jul 2, 2024

Should exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP actually be:
exec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=hyprland?
After setting this I managed to get screen sharing working in Slack, though I seem to have to click the screen in the dialog I want to use 3 times before it starts working. Thanks @brunoanc

UPDATE: Oh I see, if you have the var defined in your session, just supplying the key will pick up the setting and use the associated value. Carry on.

@VictoriaJ11
Copy link

VictoriaJ11 commented Jul 12, 2024

I also would like to help you out. And I would like to share the https://academized.com/write-my-paper website with you. If you are looking for someone who will write an essay assignment for you then you can visit the given link. The platform's commitment to academic excellence is evident in its rigorous writer selection process. Academized employs only qualified writers with proven academic backgrounds. This careful selection ensures that students receive high-quality work from knowledgeable professionals who understand the demands of academic writing.

@rbroggi
Copy link

rbroggi commented Aug 20, 2024

Hello,

I've followed the guide but cannot reliably share my screen - using chrome and many times at the first attempt after booting the PC I manage to share the screen. I've noticed an error in xdg-desktop-portal:

❯ systemctl --user status xdg-desktop-portal
● xdg-desktop-portal.service - Portal service
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static)
     Active: active (running) since Tue 2024-08-20 18:51:16 CEST; 15s ago
 Invocation: 1aa4f1aa718f49258470f665fe0ab0ac
   Main PID: 17696 (xdg-desktop-por)
      Tasks: 6 (limit: 38062)
     Memory: 3M (peak: 3.8M)
        CPU: 90ms
     CGroup: /user.slice/user-1000.slice/[email protected]/session.slice/xdg-desktop-portal.service
             └─17696 /usr/lib/xdg-desktop-portal

Aug 20 18:51:15 arch systemd[999]: Starting Portal service...
Aug 20 18:51:16 arch xdg-desktop-por[17696]: No skeleton to export
Aug 20 18:51:16 arch systemd[999]: Started Portal service.
Aug 20 18:51:21 arch xdg-desktop-por[17696]: Error deleting permission: No entry for e1507ce5-5d43-4e1c-9764-48fadc5aa10a

here is the log for the xdg-desktop-portal-hyprland:

❯ systemctl --user status xdg-desktop-portal-hyprland
● xdg-desktop-portal-hyprland.service - Portal service (Hyprland implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-hyprland.service; static)
     Active: active (running) since Tue 2024-08-20 18:14:15 CEST; 38min ago
 Invocation: c7d93452a76a44c292a6c47241c2a604
   Main PID: 4664 (xdg-desktop-por)
      Tasks: 5 (limit: 38062)
     Memory: 8.3M (peak: 257M)
        CPU: 1.858s
     CGroup: /user.slice/user-1000.slice/[email protected]/session.slice/xdg-desktop-portal-hyprland.service
             └─4664 /usr/lib/xdg-desktop-portal-hyprland

Aug 20 18:51:21 arch xdg-desktop-portal-hyprland[4664]: [LOG] [screencopy]  | /org/freedesktop/portal/desktop/session/1_56/webrtc_session914940230
Aug 20 18:51:21 arch xdg-desktop-portal-hyprland[4664]: [LOG] [screencopy]  | appid:
Aug 20 18:51:21 arch xdg-desktop-portal-hyprland[4664]: [LOG] [screencopy] SelectSources:
Aug 20 18:51:21 arch xdg-desktop-portal-hyprland[4664]: [LOG] [screencopy]  | /org/freedesktop/portal/desktop/request/1_56/webrtc200518924
Aug 20 18:51:21 arch xdg-desktop-portal-hyprland[4664]: [LOG] [screencopy]  | /org/freedesktop/portal/desktop/session/1_56/webrtc_session914940230
Aug 20 18:51:21 arch xdg-desktop-portal-hyprland[4664]: [LOG] [screencopy]  | appid:
Aug 20 18:51:21 arch xdg-desktop-portal-hyprland[4664]: [LOG] [screencopy] option persist_mode to 1
Aug 20 18:51:21 arch xdg-desktop-portal-hyprland[4664]: [LOG] [screencopy] unused option multiple
Aug 20 18:51:21 arch xdg-desktop-portal-hyprland[4664]: [LOG] [screencopy] unused option types
Aug 20 18:51:21 arch xdg-desktop-portal-hyprland[4664]: [LOG] [screencopy] restore data invalid / missing, prompting
❯ pacman -Q | grep xdg-desktop-portal-
xdg-desktop-portal-hyprland 1.3.3-2

@piyushyadav0191
Copy link

@brunoanc Sorry to disturb you but I am not able to share my screen in browsers but able to screen share in OBS. Do you know how to solve it? I have followed your steps

@heitoragm
Copy link

@rbroggi I am facing the same issue when I try to share my screen using firefox, although it works perfectly in OBS.

@piyushyadav0191
Copy link

@heitoragm Did you found the solution?

@JcBernack
Copy link

JcBernack commented Aug 23, 2024

I don't have any issues with screen share currently 🤔
The original issue I posted here that my portrait-mode screen was shared rotated might still exist (don't use rotated screen anymore), but other than that screen share has been stable.
There is nothing regarding screen share or portals in my hyprland.conf.

xdg-desktop-portal 1.18.4-1
xdg-desktop-portal-gtk 1.15.1-2
xdg-desktop-portal-hyprland 1.3.3-2
pipewire 1:1.2.2-2
wireplumber 0.5.5-1
hyprland 0.42.0-1
❯ systemctl --user status xdg-desktop-portal
● xdg-desktop-portal.service - Portal service
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static)
     Active: active (running) since Fri 2024-08-23 12:37:16 CEST; 6h ago
 Invocation: 12f56b4e3211477ea945975e1ea337db
   Main PID: 1204 (xdg-desktop-por)
      Tasks: 5 (limit: 37334)
     Memory: 7M (peak: 8M)
        CPU: 137ms
     CGroup: /user.slice/user-1000.slice/[email protected]/session.slice/xdg-desktop-portal.service
             └─1204 /usr/lib/xdg-desktop-portal

Aug 23 12:37:16 arch systemd[1046]: Starting Portal service...
Aug 23 12:37:16 arch systemd[1046]: Started Portal service.
Aug 23 18:22:30 arch xdg-desktop-por[1204]: A backend call failed: Inhibiting other than idle not supported

❯ systemctl --user status xdg-desktop-portal-hyprland
● xdg-desktop-portal-hyprland.service - Portal service (Hyprland implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-hyprland.service; static)
     Active: active (running) since Fri 2024-08-23 12:37:16 CEST; 6h ago
 Invocation: e9b121dd3f074b5f8d9e32f5648ae776
   Main PID: 1282 (xdg-desktop-por)
      Tasks: 3 (limit: 37334)
     Memory: 2.3M (peak: 15.4M)
        CPU: 495ms
     CGroup: /user.slice/user-1000.slice/[email protected]/session.slice/xdg-desktop-portal-hyprland.service
             └─1282 /usr/lib/xdg-desktop-portal-hyprland

Aug 23 19:09:59 arch xdg-desktop-portal-hyprland[1282]: [LOG] [screencopy]  | /org/freedesktop/portal/desktop/session/1_123/webrtc_session276591302
Aug 23 19:09:59 arch xdg-desktop-portal-hyprland[1282]: [LOG] [screencopy]  | appid:
Aug 23 19:09:59 arch xdg-desktop-portal-hyprland[1282]: [LOG] [screencopy] SelectSources:
Aug 23 19:09:59 arch xdg-desktop-portal-hyprland[1282]: [LOG] [screencopy]  | /org/freedesktop/portal/desktop/request/1_123/webrtc884183366
Aug 23 19:09:59 arch xdg-desktop-portal-hyprland[1282]: [LOG] [screencopy]  | /org/freedesktop/portal/desktop/session/1_123/webrtc_session276591302
Aug 23 19:09:59 arch xdg-desktop-portal-hyprland[1282]: [LOG] [screencopy]  | appid:
Aug 23 19:09:59 arch xdg-desktop-portal-hyprland[1282]: [LOG] [screencopy] option persist_mode to 1
Aug 23 19:09:59 arch xdg-desktop-portal-hyprland[1282]: [LOG] [screencopy] unused option multiple
Aug 23 19:09:59 arch xdg-desktop-portal-hyprland[1282]: [LOG] [screencopy] unused option types
Aug 23 19:09:59 arch xdg-desktop-portal-hyprland[1282]: [LOG] [screencopy] restore data invalid / missing, prompting

❯ systemctl --user status xdg-desktop-portal-gtk
● xdg-desktop-portal-gtk.service - Portal service (GTK/GNOME implementation)
     Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal-gtk.service; static)
     Active: active (running) since Fri 2024-08-23 12:37:16 CEST; 6h ago
 Invocation: 2a088b16286d446f9325c77f654bd402
   Main PID: 1223 (xdg-desktop-por)
      Tasks: 5 (limit: 37334)
     Memory: 15M (peak: 17.4M)
        CPU: 93ms
     CGroup: /user.slice/user-1000.slice/[email protected]/app.slice/xdg-desktop-portal-gtk.service
             └─1223 /usr/lib/xdg-desktop-portal-gtk

Aug 23 12:37:16 arch systemd[1046]: Starting Portal service (GTK/GNOME implementation)...
Aug 23 12:37:16 arch systemd[1046]: Started Portal service (GTK/GNOME implementation).

@heitoragm
Copy link

heitoragm commented Sep 2, 2024

@heitoragm Did you found the solution?

At the moment, I can't get it to work with XDPH. It seems like the current version needs a fix. However, I am able to screenshare using XDPW as a workaround.

@EricWardner
Copy link

This worked to fix screensharing in Chromium but it broke again when I bumped from hyprland version 0.41.2 to 0.43

@bytehaufen
Copy link

Did anybody get screen sharing get to work on non NixOs with hyprland installed over home-manager?

@Henriquelay
Copy link

Screensharing broke for me with v0.42.0. With the new aquamarine.

@alsetema
Copy link

I seem to still be having the same issue for screensharing on chrome/discord/electron. Firefox and OBS will work just fine for now, it seems like it can't find the portal somehow with

ERROR:screen_capture_portal_interface.cc(28)] Failed to get a proxy for the portal: Unknown or unsupported transport “disabled” for address “disabled"

in stdout of chrome on the terminal.

@opennomad
Copy link

I found that I had a ~/.config/xdg-desktop-portal/portals.conf file, which I assume came from my days using gnome. I removed it and copied the /usr/share/xdg-desktop-portal/hyprland-portals.conf to ~/.config/xdg-desktop-portal/portals.conf instead and that has made everything work. What gave it away is that i kept seeing references to the "gnome" portal in the logs:

xdg-desktop-portal-gnome.service: Job xdg-desktop-portal-gnome.service/start failed with result 'dependency'.

@daxisunder
Copy link

daxisunder commented Nov 9, 2024

@radholm @CRAG666

I had the same problem today and for me adding bitdepth,10 to the monitor rule in the hyprland config solved it.

monitor=,preferred,auto,auto,bitdepth,10

Not sure if it would work in your cases too, but thought it might help.

For me, it was the opposite. It was set to bitdepth,10 and didn't work, when I removed that it works.
On Intel UHD 770 graphics.

@jinnko
Copy link

jinnko commented Nov 13, 2024

@daxisunder this solved it for me!

I'm have an AMD iGPU Radeon Vega Mobile

For me, it was the opposite. It was set to bitdepth,10 and didn't work, when I removed that it works. On Intel HD 770 graphics.

@CupcakeHy
Copy link

I forked this gist to correct the mention of xdg-desktop-portal-wlr to xdg-desktop-portal-hyprland under the section with same name (guessing that you wanted to refer to the later).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment