Currently MC skins (e.g. Noire) for Windows and Mac can detect the operating system and use the appropriate window buttons. Currently this doesn't work on Linux, most likely due to countless distributions and desktop environments out there. Fortunately, I believe I have a way to easily detect the desktop environment and the session with (hopefully) minimal changes required.
Basically, two commands are required to detect both;
echo $XDG_CURRENT_DESKTOP
And...
echo $DESKTOP_SESSION
The two commands can be used to determine what DE/session is running, for example;
KDE:
XDG_CURRENT_DESKTOP=
GDMSESSION=kde-plasma
Unity (Running With Mir):
XDG_CURRENT_DESKTOP=Unity
GDMSESSION=ubuntu
Note MIR_SERVER_NAME is also set
MIR_SERVER_NAME=session-$NUMBER
Unity 3d:
XDG_CURRENT_DESKTOP=Unity
GDMSESSION=ubuntu
Unity 2d:
XDG_CURRENT_DESKTOP=Unity
GDMSESSION=ubuntu-2d
Gnome:
XDG_CURRENT_DESKTOP=GNOME
GDMSESSION=gnome-shell
Gnome Classic:
XDG_CURRENT_DESKTOP=GNOME
GDMSESSION=gnome-classic
Gnome Classic (no effects):
XDG_CURRENT_DESKTOP=GNOME
GDMSESSION=gnome-fallback
XFCE:
XDG_CURRENT_DESKTOP=XFCE
GDMSESSION=xfce
Mint 17 (Cinnamon):
XDG_CURRENT_DESKTOP=X-Cinnamon
GDMSESSION=default
Lubuntu:
XDG_CURRENT_DESKTOP=LXDE
GDMSESSION=Lubuntu
Only Unity when running Mir (which is likely unsupported to begin with unless XMir is worth a darn) has an additional variable set and KDE returns with a null XDG_CURRENT_DESKTOP result.
Thoughts?