ss7m / paleofetch

neofetch, but written in C
MIT License
168 stars 49 forks source link

Thoughts on a minimalist approach to saying something about the user's interface. #30

Open allisio opened 4 years ago

allisio commented 4 years ago

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 like spectrwm, xfce4-session, etc.

Not exactly "pretty", but it'd get us ~80% of the way there for free.

ss7m commented 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?

allisio commented 4 years ago

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.

ss7m commented 4 years ago

That seems like a reasonable addition. If you make the pull request I'll look it over later.

GOKOP commented 4 years ago

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.

GUI login managers don't use xinit