I’ve been able to use screen sharing on wayland before and recently it just hasn’t been working when trying on Discord (via vesktop) and even Teams via a browser (librewolf). I had both of these working before.
Here’s my configuration for screensharing:
{pkgs, ...}: {
xdg = {
portal = {
enable = true;
wlr.enable = true;
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
};
};
security.rtkit.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
# jack.enable = true;
# media-session.enable = true;
};
}
I can’t seem to even find the xdg-desktop-portal-wlr.service or any portal-related services.
Anyone know what is going on?
Okay, so I can find the xdg-desktop-portal-*.services, they are just run as user services and I wasn’t passing --user to systemctl, oops.
Not showing much useful information though. I reckon I’m missing a picker for the display maybe?
Okay, I think I’ve mostly resolved this on my own with the following:
{pkgs, ...}: {
xdg = {
portal = {
enable = true;
wlr = {
enable = true;
settings = {
screencast = {
chooser_type = "simple";
chooser_cmd = "${pkgs.slurp}/bin/slurp -f 'Monitor: %o' -or";
};
};
};
extraPortals = [
pkgs.xdg-desktop-portal-gtk
];
};
};
security.rtkit.enable = true;
services.pipewire = {
enable = true;
pulse.enable = true;
alsa.enable = true;
alsa.support32Bit = true;
# jack.enable = true;
# media-session.enable = true;
};
}
But I think vesktop is still not having it. OBS is working though.
Those settings might not work for every Wayland compositor. Have you seen what programs.niri does?
# treatment as the display-manager modules.
systemd.user.services.niri = {
restartIfChanged = false;
# Defining the unit here generates a drop-in; without this it
# would carry the NixOS default Environment="PATH=coreutils:…",
# clobbering the PATH that niri-session imported into the user
# manager and breaking spawn actions that rely on it.
enableDefaultPath = false;
};
xdg.portal = {
enable = lib.mkDefault true;
# NOTE: `configPackages` is ignored when `xdg.portal.config.niri` is defined.
config.niri = {
default = [
"gnome"
"gtk"
];
"org.freedesktop.impl.portal.Access" = "gtk";
"org.freedesktop.impl.portal.FileChooser" = lib.mkIf (!cfg.useNautilus) "gtk";
1 Like