David writes:
On Mon, 4 Nov 2019 at 08:11, Dan Hitt <dan.hitt@gmail.com> wrote: > > I still would like a programmatic/command-line way of detecting what the desktop. Try this command, shown here with the output I get on my system which uses the LXDE desktop. Whatever output you get will depend on whatever environment variables your desktop sets. $ env | grep -i DESKTOP DESKTOP_SESSION=LXDE XDG_SESSION_DESKTOP=lightdm-xsession XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0 XDG_CURRENT_DESKTOP=LXDE XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
Thanks for sharing this. I did not know such a simple means of getting information about a variety of window managers / desktop environments exists. It even works for i3 (although only one variable is being set and does not correspond to any of the listed ones from above): $ env | grep -i DESKTOP DESKTOP_STARTUP_ID=i3/|usr|bin|materm/2155-5-masysma-9_TIME1931107 Btw. I like writing `grep -i DESKTOP`. `-i` makes it case-insensitive but by writing `DESTKOP` it is being hinted that this value is supposed to often occur in all caps :) Thanks again Linux-Fan