I have searched (googled) quite a bit for an solution to determine what the last DE of choice was while in TTY.
Because the usual variable such as $DESKTOP_SESSION were not available. I need your help please.
After quite a bit of searching the only solution I found was:
The file lightdm.conf shows the user session and with "grep"ing a line and then with "column remove" I managed to get the exact result.
cat /etc/lightdm/lightdm.conf | grep user-session= | colrm 1 13
The reason I wanted this is because I wish to install some tweaks with a bash script on a minimal system.
$MySession='cat /etc/lightdm/lightdm.conf | grep user-session= | colrm 1 13'
if [ $MySession = "xubuntu" ] then
elif [ $MySession = "ubuntu" ] then
echo "Desktop session not recognized. "
I'd imagine that looking into a file is not the best way to choose. Therefor I'm wandering if this can be accomplished in a more definitive or reliable way from the TTY. Any help will be appreciated. Thanks in advanced.