# -----------------------------------------------------
# 3. FIX: Auto-start screen sharing for Mango/Wayland
# -----------------------------------------------------
if [ -n "$WAYLAND_DISPLAY" ] && [ "$XDG_CURRENT_DESKTOP" = "mango" ]; then
# Check if systemd actually has the WAYLAND_DISPLAY variable loaded
if ! systemctl --user show-environment | grep -q "^WAYLAND_DISPLAY="; then
# 1. Import vars so systemd sees Wayland
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
# 2. Restart services to pick up the new vars
systemctl --user stop xdg-desktop-portal xdg-desktop-portal-wlr
systemctl --user start xdg-desktop-portal-wlr
systemctl --user start xdg-desktop-portal
fi
fi
this code block doesn’t work anymore
created on: Thu Jul 02 2026