V0rt3x667 / ArchyPie-Setup

A Clone of RetroPie for Arch Based Systems
GNU General Public License v3.0
32 stars 9 forks source link

Test Experimental Video Detection #38

Closed V0rt3x667 closed 11 months ago

V0rt3x667 commented 11 months ago

Replace the hacky and not very robust method of detecting x11/wayland/kms use via reading the envar XDG_SESSION_TYPE.

The following un-merged pull request has been submitted to the RetroPie Project. I would like to adopt it early with some modifications: https://github.com/RetroPie/RetroPie-Setup/pull/3686

TARGETS:

V0rt3x667 commented 11 months ago

ON HOLD!

After doing further research I have come to the conclusion that there is no reliable one size fits all solution to determine session type. XDG_SESSION_TYPE is a none starter because it can be set by a display manger but what if you don't use one? It can also be set by the desktop or compositor but what if you use a desktop that does not set this envar? How about building a binary via SSH which sets XDG_SESSION_TYPE to tty? The build won't work on x11 or wayland as it assumes a kms setup.

Other solutions rely on parsing loginctl such as loginctl show-session $(awk -v u="$USER" '$0 ~ u{print $1}'<<<$(loginctl)) -p Type. What about users of distros like Artix that do not use systemd as an init system?

V0rt3x667 commented 11 months ago

I have reverted the main branch to the default RetroPie behaviour. I will keep the test_video branch as alternative for anyone wishing to use it.