Open allisio opened 4 years ago
I remember you mentioned you had wrote a function about getting the name of the window manager- is that what you're referring to?
Well, this would "work" for desktop environments as well as window managers, and without all the unpleasant X querying. We'd just pidof xinit
, get its children, ignore the first one (which would always be Xorg
), and use the /proc/PID/comm
of the second as a reasonable guess at what the user is running.
That seems like a reasonable addition. If you make the pull request I'll look it over later.
Well, this would "work" for desktop environments as well as window managers, and without all the unpleasant X querying. We'd just
pidof xinit
, get its children, ignore the first one (which would always beXorg
), and use the/proc/PID/comm
of the second as a reasonable guess at what the user is running.
GUI login managers don't use xinit
I know we don't wanna become
neofetch
(in terms of SLOC nor the headache of special-casing so many things), but the fact that we don't say anything about the user's environment is conspicuous.I think a sensible approach to providing some sort of umbrella "interface" datum would be to report the name of the command attached to the
Xorg
process's immediate sibling. This would be things likespectrwm
,xfce4-session
, etc.Not exactly "pretty", but it'd get us ~80% of the way there for free.