don't rely on XDG_SESSION_TYPE for desktop choosing (but do prefer it) #13

Closed
opened 2026-03-31 02:11:08 +09:00 by IoI_xD · 1 comment
Owner

on one hand, i have a pet peeve where every library has their own env variable for overriding which protocol it uses, when XDG_SESSION_TYPE is Right there and doesn't rely on me knowing what the program happens to be built with. On the other hand, since its technically "not standard", some compositors (Weston) apparently don't set it.

My idea, then, is:
a.) Introduce "MILSKO_BACKEND" as the top priority for deciding whether the x11 or wayland backend is used, but:
b.) Check XDG_SESSION_TYPE and then rely on it If it is set to either "x11" or "wayland".
c.) If it is set to anything else (i.e. tty) then we check for the existence of WAYLAND_DISPLAY and DISPLAY respectively.

on one hand, i have a pet peeve where every library has their own env variable for overriding which protocol it uses, when XDG_SESSION_TYPE is Right there and doesn't rely on me knowing what the program happens to be built with. On the other hand, since its technically "not standard", some compositors (Weston) apparently don't set it. My idea, then, is: a.) Introduce "MILSKO_BACKEND" as the top priority for deciding whether the x11 or wayland backend is used, but: b.) Check XDG_SESSION_TYPE and then rely on it If it is set to either "x11" or "wayland". c.) If it is set to anything else (i.e. tty) *then* we check for the existence of `WAYLAND_DISPLAY` and `DISPLAY` respectively.
Author
Owner

fixed

fixed
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pyrite-dev/milsko#13
No description provided.