zoom: switch to Wayland & support webrtc screen sharing

i set this XDG_SESSION_TYPE=wayland system-wide because it's also needed for EVERY screensharing client. sad
This commit is contained in:
2025-08-01 01:47:04 +00:00
parent fb64d1ad50
commit 62cf79e60d
2 changed files with 35 additions and 3 deletions

View File

@@ -319,6 +319,13 @@ in
# docs: <https://discourse.ubuntu.com/t/environment-variables-for-wayland-hackers/12750>
# N.B.: gtk apps support absolute paths for this; webkit apps (e.g. geary) support only relative paths (relative to $XDG_RUNTIME_DIR)
env.WAYLAND_DISPLAY = "wl/wayland-1";
# XXX(2025-07-31): XDG_SESSION_TYPE=wayland is ingested by a number of libraries/application frameworks
# - Qt reads this to decide X11 (default) v.s. Wayland (alternatively, set QT_QPA_PLATFORM=wayland).
# - webrtc screen sharing *requires* this to be set else it can only share X11 windows. <https://github.com/emersion/xdg-desktop-portal-wlr/wiki/Screencast-Compatibility>
# - affects Firefox, Zoom, maybe others?
# - Komikku crashes without this set.
# - xdg-desktop-portal-gnome requires this to be set??
env.XDG_SESSION_TYPE = "wayland";
# services.private-storage.dependencyOf = [ "sway" ]; #< HACK: prevent unl0kr and sway from fighting over the tty
services.sway = {

View File

@@ -1,11 +1,35 @@
# FIRST TIME SETUP:
# - in ~/.config/zoom/zoomus.conf: toggle `xwayland=true` -> `xwayland=false`
#
# tips for configuring zoom:
# - <https://wiki.archlinux.org/title/Zoom_Meetings>
# - <https://www.reddit.com/r/archlinux/comments/19ecsv5/comment/ktot9hf/>
# webrtc screen sharing:
# - <https://github.com/emersion/xdg-desktop-portal-wlr/wiki/Screencast-Compatibility>
# - <https://wiki.archlinux.org/title/PipeWire#WebRTC_screen_sharing>
# - <https://mozilla.github.io/webrtc-landing/gum_test.html>
{ pkgs, ... }:
{
sane.programs.zoom-us = {
packageUnwrapped = pkgs.zoom-us.override {
packageUnwrapped = (pkgs.zoom-us.override {
xdgDesktopPortalSupport = true; #< what does this do? who knows!
# gnomeXdgDesktopPortalSupport = true;
# wlrXdgDesktopPortalSupport = true;
};
});
# .overrideAttrs (upstream: {
# # force wayland. even w/ x11 removed from the sandbox, it still manages to connect! probably it does it via the network.
# # so explicitly set QT_QPA_PLATFORM=wayland, and as a precaution, unset `DISPLAY`
# # XXX(2025-07-31): QT_QPA_PLATFORM=wayland is NOT needed if XDG_SESSION_TYPE=wayland is set instead.
# # XDG_SESSION_TYPE=wayland is *also* required for pipewire screen sharing to work.
# # setting anything here is no longer required, as i set XDG_SESSION_TYPE at the sway layer.
# nativeBuildInputs = (upstream.nativeBuildInputs or []) ++ [
# pkgs.makeShellWrapper
# ];
# buildCommand = upstream.buildCommand + ''
# wrapProgram $out/bin/zoom \
# --run 'if [[ -n "''${WAYLAND_DISPLAY:-}" ]]; then export QT_QPA_PLATFORM=wayland; unset DISPLAY; fi'
# '';
# });
sandbox.net = "clearnet";
sandbox.whitelistAudio = true;
sandbox.whitelistAvDev = true; #< XXX(2025-05-29): it doesn't use pipewire for mic/video
@@ -16,7 +40,7 @@
"ScreenCast" # not sure if used
];
sandbox.whitelistWayland = true;
sandbox.whitelistX = true; # XXX(2025-05-29): required; TODO: try setting QP_... env vars to get native wayland?
# sandbox.whitelistX = true; # XXX(2025-05-29): required; TODO: try setting QP_... env vars to get native wayland?
sandbox.tmpDir = ".cache/.zoom"; #< tmpdir needs to be shared between instances, for the singleton socket to work (also, it needs to exist)
mime.associations."x-scheme-handler/zoommtg" = "Zoom.desktop"; #< for when you click on a meeting link
# TODO: .config/Unknown Organization/zoom.conf
@@ -24,6 +48,7 @@
".cache/zoom" # 8MB qmlcache + 400MB app data (assets Zoom downloads at runtime instead of shipping the package) via the ~/.zoom -> .cache/zoom
".config/zoom"
];
# coerce Zoom into using XDG dirs:
fs.".zoom".symlink.target = ".cache/zoom";
fs.".config/zoom.conf".symlink.target = "zoom/zoom.conf";