You are not logged in.

#1 2023-10-20 07:58:36

Cokegod
Member
Registered: 2015-12-24
Posts: 5

[SOLVED] swaywm: XDG_CURRENT_DESKTOP not set

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

#2 2023-10-20 15:30:53

twelveeighty
Member
Registered: 2011-09-04
Posts: 1,319

Re: [SOLVED] swaywm: XDG_CURRENT_DESKTOP not set

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

#3 2023-10-20 17:47:00

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: [SOLVED] swaywm: XDG_CURRENT_DESKTOP not set

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

#4 2023-11-01 10:17:02

Cokegod
Member
Registered: 2015-12-24
Posts: 5

Re: [SOLVED] swaywm: XDG_CURRENT_DESKTOP not set

twelveeighty wrote:

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.


progandy wrote:

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

#5 2023-11-01 10:29:40

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: [SOLVED] swaywm: XDG_CURRENT_DESKTOP not set

Sorry, I meant XDG_CURRENT_DESKTOP, no idea why I wrote xdg_desktop_portal.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#6 2023-11-02 07:04:16

Cokegod
Member
Registered: 2015-12-24
Posts: 5

Re: [SOLVED] swaywm: XDG_CURRENT_DESKTOP not set

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

#7 2023-11-02 07:21:33

seth
Member
Registered: 2012-09-03
Posts: 63,509

Re: [SOLVED] swaywm: XDG_CURRENT_DESKTOP not set

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

Board footer

Powered by FluxBB