sway: Simplify screen sharing

This should make it easier to get started.
The xdg-desktop-portal backend for wlroots is required and one needs to
"make sure WAYLAND_DISPLAY and XDG_CURRENT_DESKTOP are imported into
D-Bus." [0]

[0]: efcbcb60aa/README.md (running)
This commit is contained in:
Michael Weiss 2021-05-14 22:17:45 +02:00
parent a17bfa39ce
commit 3f31c0edef
No known key found for this signature in database
GPG Key ID: 5BE487C4D4771D83

View File

@ -124,7 +124,7 @@ in {
"sway/config.d/nixos.conf".source = pkgs.writeText "nixos.conf" ''
# Import the most important environment variables into the D-Bus and systemd
# user environments (e.g. required for screen sharing and Pinentry prompts):
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK
exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
'';
};
};
@ -135,6 +135,8 @@ in {
# To make a Sway session available if a display manager like SDDM is enabled:
services.xserver.displayManager.sessionPackages = [ swayPackage ];
programs.xwayland.enable = mkDefault true;
# For screen sharing (this option only has an effect with xdg.portal.enable):
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-wlr ];
};
meta.maintainers = with lib.maintainers; [ gnidorah primeos colemickens ];