FyshOS / fin

A Fyne login manager for linux desktop computers
Other
26 stars 6 forks source link

XDG Spec isn't followed correctly for xsession directories #15

Closed taigrr closed 2 years ago

taigrr commented 2 years ago

According to the XDG spec: (here)

  1. XDG_DATA_HOME takes precedence
  2. but if it's not set, it should be assumed to be $HOME/.local/share
  3. Additionally, XDG_DATA_DIRS contains system-wide data which should be taken into account at a lower precedence.
  4. If empty, assume it is /usr/local/share/:/usr/share/

Currently, the code is backwards, checking the XDG_DATA_DIRS variable first, with a couple of fallbacks. XDG_DATA_HOME should be used first, with XDG_DATA_DIRS as a fallback.

The reason this distinction is important: As it is right now, a non-root user is unable to customize their xsessions list, as on any normal system with XDG_DATA_DIRS set, user config files will not be read.

Jacalz commented 2 years ago

I just want to say that you don't necessarily need to create an issue just to open a PR. It's fine to just open a PR if you want to do so.

taigrr commented 2 years ago

Thanks @Jacalz , I'll take that going forward but there was more context here in some Slack messages.

andydotxyz commented 2 years ago

Thanks for resolving this @taigrr