{"slug": "screen-sharing-on-hyprland-arch-linux", "title": "Screen sharing on Hyprland (Arch Linux)", "summary": "This article provides a step-by-step guide for setting up screen sharing on the Hyprland compositor in Arch Linux, primarily for use with OBS. It covers installing necessary packages like PipeWire, WirePlumber, and either `xdg-desktop-portal-hyprland` or `xdg-desktop-portal-wlr`, along with configuration and troubleshooting steps. The guide assumes basic Linux knowledge and warns against having conflicting portal implementations installed.", "body_md": "# Screen sharing on Hyprland (Arch Linux)\n\n## Table of contents\n- [Screen sharing on Hyprland (Arch Linux)](#screen-sharing-on-hyprland--arch-linux-)\n  * [Introduction](#introduction)\n  * [Install PipeWire and friends](#install-pipewire-and-friends)\n  * [Install xdg-desktop-portal and friends](#install-xdg-desktop-portal-and-friends)\n    + [Option #1: xdg-desktop-portal-hyprland (recommended)](#option--1--xdg-desktop-portal-hyprland--recommended-)\n    + [Option #2: xdg-desktop-portal-wlr (not recommended)](#option--2--xdg-desktop-portal-wlr--not-recommended-)\n  * [Remove other portal implementations](#remove-other-portal-implementations)\n  * [Edit the configuration file](#edit-the-configuration-file)\n  * [Restart your session](#restart-your-session)\n  * [Troubleshooting PipeWire](#troubleshooting-pipewire)\n  * [Troubleshooting desktop portal](#troubleshooting-desktop-portal)\n    + [`Portal service (wlroots implementation) was skipped because of a failed condition check`](#-portal-service--wlroots-implementation--was-skipped-because-of-a-failed-condition-check-)\n    + [`unsupported wl_shm format 0x34324742` (after trying to share the screen on NVIDIA)](#-unsupported-wl-shm-format-0x34324742---after-trying-to-share-the-screen-on-nvidia-)\n  * [Troubleshooting OBS](#troubleshooting-obs)\n  * [Troubleshooting your browser](#troubleshooting-your-browser)\n    + [Firefox](#firefox)\n    + [Chromium](#chromium)\n  * [Troubleshooting your app](#troubleshooting-your-app)\n  * [It still doesn't work!](#it-still-doesn-t-work-)\n  * [References](#references)\n\n## Introduction\nThis guide will go through the setup and troubleshooting steps required to get screen sharing working on OBS with the [Hyprland](https://github.com/vaxerski/Hyprland) compositor.\n\nThis guide will use the `yay` AUR helper for AUR package installation, but the commands should be similar for other helpers such as `paru`.\n\n**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.\n\n## Install PipeWire and friends\nFirst, we need to install `pipewire` and `wireplumber`. To do that, run the following command:\n```\nsudo pacman -S pipewire wireplumber\n```\n\n## Install xdg-desktop-portal and friends\n### Option #1: xdg-desktop-portal-hyprland (recommended)\nWe will install the [`xdg-desktop-portal-hyprland-git`](https://aur.archlinux.org/packages/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:\n```\nyay -S xdg-desktop-portal-hyprland-git\n```\n\n### Option #2: xdg-desktop-portal-wlr (not recommended)\nThis option provides less options than `xdg-desktop-portal-wlr`, but it will still allow fullscreen sharing. Install it running the following command:\n```\nsudo pacman -S xdg-desktop-portal-wlr\n```\n**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.\n\n## Remove other portal implementations\nMake 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:\n```\npacman -Q | grep xdg-desktop-portal-\n```\nthen delete all of the listed packages except the `-hyprland` one we just installed and the `-gtk` one if you so chose.\n\nAlso make sure to install the optional dependencies `grim` and `slurp`:\n```\nsudo pacman -S grim slurp\n```\n\n## Editing the configuration file\nOpen your Hyprland config file (usually located at `~/.config/hypr/hyprland.conf`) with a text editor, and add the following line at the end:\n```\nexec-once=dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP\n```\nThis will make sure that `xdg-desktop-portal-hyprland` can get the required variables on startup.\n\n## Restart your session\nNow 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.\n\nIf it works, congratulations! You may exit this guide now. If not, follow along:\n\n## Troubleshooting PipeWire\nMake sure both `pipewire` and `wireplumber` are running. Run the following command:\n```\nsystemctl --user status pipewire wireplumber\n```\nThis should return \"active (running)\" for both. If it doesn't, follow the [Arch Wiki article](https://wiki.archlinux.org/title/PipeWire) for troubleshooting.\n\n## Troubleshooting desktop portal\nRun the following command to check for errors in `xdg-desktop-portal-hyprland`:\n```\nsystemctl --user status xdg-desktop-portal-hyprland\n```\nThis should return \"active (running)\". If it doesn't, check the errors it gives you. Here's some workarounds for common errors:\n\n### `Portal service (wlroots implementation) was skipped because of a failed condition check`\nMake sure you added the required line to the Hyprland configuration. Check for typos.\n\n### `unsupported wl_shm format 0x34324742` (after trying to share the screen on NVIDIA)\nInstall the modified [hyprland-nvidia-git](https://aur.archlinux.org/packages/hyprland-nvidia-git) AUR package:\n```\nyay -S hyprland-nvidia-git\n```\nAlternatively, you can modify the source code manually:\n\nWe'll need to modify the `wlroots` submodule source code to make it choose a viable format.\n\nFirst, clone the [Hyprland](https://github.com/vaxerski/Hyprland) repo if you haven't already:\n```\ngit clone --recursive https://github.com/vaxerski/Hyprland\n```\nThen, install all required dependencies for building, as specified in the wiki:\n```\nsudo 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\n```\nOpen the `wlroots/types/output/render.c` file, look for the `wlr_output_preferred_read_format`, and replace it with the following:\n```\nuint32_t wlr_output_preferred_read_format(struct wlr_output *output) {\n    return DRM_FORMAT_XRGB8888;\n}\n```\nAfterwards, compile and install by running `sudo make install`, then restart your session.\n\n## Troubleshooting OBS\nYou can try the [wlrobs-hg](https://aur.archlinux.org/packages/wlrobs-hg) plugin.\n\n## Troubleshooting your browser\nIf 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.\n\n### Firefox\nMake 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\".\nIf it isn't, set the environment variable `MOZ_ENABLE_WAYLAND=1` in an environment file, like `/etc/environment`, `/etc/profile`, `~/.bash_profile`, `~/.zshenv`, etc.\n\nIf it still doesn't work, open `about:config` and make sure the `media.peerconnection.enabled` flag is set to true.\n\n### Chromium\nTo 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).\n\nAlso ensure the \"WebRTC PipeWire support\" flag is enabled by opening `chrome://flags/#enable-webrtc-pipewire-capturer` and enabling it.\n\n## Troubleshooting your app\nMake sure the app you're trying to share the screen with supports Wayland and sharing the screen with it.\n\nNotable programs that still don't have full support for this are Discord and Zoom.\n\n## It still doesn't work!\nFollow the [official xdg-desktop-portal-wlr troubleshooting guide](https://github.com/emersion/xdg-desktop-portal-wlr/wiki/\"It-doesn't-work\"-Troubleshooting-Checklist).\n\nIf it still doesn't work, consider opening an issue in the [`xdg-desktop-portal-hyprland` repo](https://github.com/hyprwm/xdg-desktop-portal-hyprland).\n\n## References\n* <https://wiki.archlinux.org/title/PipeWire>\n* <https://github.com/emersion/xdg-desktop-portal-wlr/issues/216>\n* <https://github.com/emersion/xdg-desktop-portal-wlr/issues/190#issuecomment-1144287165>\n* <https://github.com/emersion/xdg-desktop-portal-wlr/wiki>\n* <https://wiki.archlinux.org/title/Firefox#Wayland>\n* <https://wiki.archlinux.org/title/chromium#Native_Wayland_support>\n", "url": "https://wpnews.pro/news/screen-sharing-on-hyprland-arch-linux", "canonical_source": "https://gist.github.com/brunoanc/2dea6ddf6974ba4e5d26c3139ffb7580", "published_at": "2022-06-17 05:06:39+00:00", "updated_at": "2026-05-22 13:49:44.163351+00:00", "lang": "en", "topics": ["open-source", "developer-tools", "products"], "entities": ["Hyprland", "Arch Linux", "PipeWire", "WirePlumber", "xdg-desktop-portal-hyprland", "OBS", "yay", "paru"], "alternates": {"html": "https://wpnews.pro/news/screen-sharing-on-hyprland-arch-linux", "markdown": "https://wpnews.pro/news/screen-sharing-on-hyprland-arch-linux.md", "text": "https://wpnews.pro/news/screen-sharing-on-hyprland-arch-linux.txt", "jsonld": "https://wpnews.pro/news/screen-sharing-on-hyprland-arch-linux.jsonld"}}