summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorMichael Weiss <dev.primeos@gmail.com>2021-05-14 22:17:45 +0200
committerMichael Weiss <dev.primeos@gmail.com>2021-05-14 22:42:19 +0200
commit3f31c0edefdc99e1ba66a35ab0995887db883fc5 (patch)
tree6f873af7e643f10df7f4f8271e7210eb5a77fd18 /nixos
parenta17bfa39ceb81d26c5814d657fdd6935da10556a (diff)
downloadnixpkgs-3f31c0edefdc99e1ba66a35ab0995887db883fc5.tar
nixpkgs-3f31c0edefdc99e1ba66a35ab0995887db883fc5.tar.gz
nixpkgs-3f31c0edefdc99e1ba66a35ab0995887db883fc5.tar.bz2
nixpkgs-3f31c0edefdc99e1ba66a35ab0995887db883fc5.tar.lz
nixpkgs-3f31c0edefdc99e1ba66a35ab0995887db883fc5.tar.xz
nixpkgs-3f31c0edefdc99e1ba66a35ab0995887db883fc5.tar.zst
nixpkgs-3f31c0edefdc99e1ba66a35ab0995887db883fc5.zip
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]: https://github.com/emersion/xdg-desktop-portal-wlr/blob/efcbcb60aa3bc46b0e290d5f6627783fbb534dcd/README.md#running
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/programs/sway.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/nixos/modules/programs/sway.nix b/nixos/modules/programs/sway.nix
index 2b69851b340..ca79177f827 100644
--- a/nixos/modules/programs/sway.nix
+++ b/nixos/modules/programs/sway.nix
@@ -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 ];