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 2698 times)

Awesome Donkey

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 7367
  • The color of Spring...

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 Viagra and other sources of sketchy pharmaceuticals.

Windows 11 2023 Update (23H2) 64-bit + Ubuntu 24.04 LTS Noble Numbat 64-bit | Windows 11 2023 Update (23H2) 64-bit (Intel N305 Fanless NUC 16GB RAM/256GB NVMe SSD)
JRiver Media Center 32 (Windows + Linux) | Topping D50s DAC | Edifier R2000DB Bookshelf Speakers

bob

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 13487
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: 7367
  • The color of Spring...
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 Viagra and other sources of sketchy pharmaceuticals.

Windows 11 2023 Update (23H2) 64-bit + Ubuntu 24.04 LTS Noble Numbat 64-bit | Windows 11 2023 Update (23H2) 64-bit (Intel N305 Fanless NUC 16GB RAM/256GB NVMe SSD)
JRiver Media Center 32 (Windows + Linux) | Topping D50s DAC | Edifier R2000DB Bookshelf Speakers

mwillems

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 5174
  • "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: 7367
  • The color of Spring...
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 Viagra and other sources of sketchy pharmaceuticals.

Windows 11 2023 Update (23H2) 64-bit + Ubuntu 24.04 LTS Noble Numbat 64-bit | Windows 11 2023 Update (23H2) 64-bit (Intel N305 Fanless NUC 16GB RAM/256GB NVMe SSD)
JRiver Media Center 32 (Windows + Linux) | Topping D50s DAC | Edifier R2000DB Bookshelf Speakers
Pages: [1]   Go Up