INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: [Request] Detect the desktop environment + session MC is running on  (Read 3081 times)

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7804
  • Autumn shade...

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?
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13870
Re: [Request] Detect the desktop environment + session MC is running on
« Reply #1 on: August 10, 2015, 10:40:42 am »

What window buttons are you thinking of?
Logged

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7804
  • Autumn shade...
Re: [Request] Detect the desktop environment + session MC is running on
« Reply #2 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.
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5234
  • "Linux Merit Badge" Recipient
Re: [Request] Detect the desktop environment + session MC is running on
« Reply #3 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?
Logged

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7804
  • Autumn shade...
Re: [Request] Detect the desktop environment + session MC is running on
« Reply #4 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. :)
Logged
I don't work for JRiver... I help keep the forums safe from "male enhancements" and other sources of sketchy pharmaceuticals.

Windows 11 24H2 Update 64-bit + Ubuntu 24.10 Oracular Oriole 64-bit | Windows 11 24H2 Update 64-bit (Intel N305 Fanless NUC 16GB RAM/500GB M.2 NVMe SSD)
JRiver Media Center 33 (Windows + Linux) | iFi ZEN DAC 3 | JBL 306P MkII Studio Monitors | Audio-Technica ATH-M50x Headphones
Pages: [1]   Go Up