INTERACT FORUM

More => Old Versions => JRiver Media Center 21 for Linux => Topic started by: Awesome Donkey on August 09, 2015, 05:40:38 pm

Title: [Request] Detect the desktop environment + session MC is running on
Post by: Awesome Donkey on August 09, 2015, 05:40:38 pm
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;

Code: [Select]
echo $XDG_CURRENT_DESKTOP
And...

Code: [Select]
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?
Title: Re: [Request] Detect the desktop environment + session MC is running on
Post by: bob on August 10, 2015, 10:40:42 am
What window buttons are you thinking of?
Title: Re: [Request] Detect the desktop environment + session MC is running on
Post by: Awesome Donkey on August 10, 2015, 12:45:33 pm
I'm thinking starting with three basic ones; GNOME, Unity (Ubuntu) and Xfce - leave third-party skin developers to the rest of them. I've got Debian installing in a virtual machine right now with multiple DE's so I can hunt down the images.

The only problem is, there doesn't seem to be any scaled images for Ubuntu. They're all 1X still, which is a bummer, so scaling them might be an issue.
Title: Re: [Request] Detect the desktop environment + session MC is running on
Post by: mwillems on August 10, 2015, 12:57:23 pm
I think bob was asking which specific buttons; I think A.D. is talking about the minimize, maximize, and close buttons on the main MC window?
Title: Re: [Request] Detect the desktop environment + session MC is running on
Post by: Awesome Donkey on August 10, 2015, 06:07:28 pm
I think bob was asking which specific buttons; I think A.D. is talking about the minimize, maximize, and close buttons on the main MC window?

Err, yeah. At the very least having the ability for third-party skinners to take advantage of this would be great to have. :)