You are not logged in.
I have been doing screencasting on sway for years now and don't remember having to configure anything special for it to work other than installing xdg-desktop-portal-wlr. As far as I recall last time I tried to use it was about 1-2 months ago, and it worked.
Today I tried to do it again and it failed. I looked at the wiki and did see that there is a specific section on troubleshooting screencasting with sway. I then checked and XDG_CURRENT_DESKTOP was indeed not set for me, which was the cause for screencasting not working.
What I find really odd is that screencasting used to work for me, so I'm really not sure what changed? More than that, the wiki itself says that the sway package provides a config file to take care of this, which I use (and have been using before I had this issue). The issue is that the config file provided has these lines:
exec systemctl --user import-environment DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
exec hash dbus-update-activation-environment 2>/dev/null && \
dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY SWAYSOCK XDG_CURRENT_DESKTOP
While the wiki recommends doing this:
systemctl --user import-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP
dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=compositor_name
Basically the config file assumes I already have XDG_CURRENT_DESKTOP set as an environment variable and just imports its value, while the wiki does not.
Did anyone else experience a similar regression recently? Any idea what caused this?
Also, so what is the expected configuration I should have here? Should I set the environment variable XDG_CURRENT_DESKTOP=SWAY before running sway? Why can't sway (or the config included in the sway package) do it?
Update:
Apparently I was not the only one facing this issue, a recent patch to the sway Arch package fixes this.
Last edited by Cokegod (2023-11-02 07:25:37)
Offline
FWIW - that link you referenced instructs you to set XDG_CURRENT_DESKTOP=sway, not XDG_CURRENT_DESKTOP=SWAY. The setting of XDG_CURRENT_DESKTOP is case-sensitive.
Offline
There is a recent change to xdg-desktop-portal that needs new configuration, but this should not impact screencasting.
https://bbs.archlinux.org/viewtopic.php?id=289405
Edit: I think this is more to do with the fallback portals, I'd guess the wlr portal should work without this.
And yes, you need to set XDG_CURRENT_DESKTOP yourself if your display manager does not do it. The variable has to be set before sway is launched not afterwards.
Last edited by progandy (2023-11-01 10:29:14)
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
FWIW - that link you referenced instructs you to set XDG_CURRENT_DESKTOP=sway, not XDG_CURRENT_DESKTOP=SWAY. The setting of XDG_CURRENT_DESKTOP is case-sensitive.
Strange, SWAY with all caps works for me.
There is a recent change to xdg-desktop-portal that needs new configuration, but this should not impact screencasting.
https://bbs.archlinux.org/viewtopic.php?id=289405
Edit: I think this is more to do with the fallback portals, I'd guess the wlr portal should work without this.And yes, you need to set XDG_DESKTOP_PORTAL yourself if your display manager does not do it. The variable has to be set before sway is launched not afterwards.
Yeah I guess this is also some effect of a recent xdg-desktop-portal change, although I am not sure why. I will set XDG_CURRENT_DESKTOP from now on, but I am still not sure why doesn't the sway Arch package do it by its own.
Last edited by Cokegod (2023-11-01 10:32:06)
Offline
Sorry, I meant XDG_CURRENT_DESKTOP, no idea why I wrote xdg_desktop_portal.
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Update:
Seems that I was right all along. So apparently I was not the only one facing this issue, as a recent patch to the sway Arch package fixes this.
Offline
Please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.
Offline