В чем разница между DESKTOP_SESSION, XDG_SESSION_DESKTOP и XDG_CURRENT_DESKTOP?

2990
Sora Minazuki

Я хочу определить, какой менеджер рабочего стола я использую, и обнаружил, что есть три переменные среды DESKTOP_SESSION, XDG_SESSION_DESKTOPи XDG_CURRENT_DESKTOPкоторые могут помочь мне в этом. Но в чем именно разница между этими тремя переменными? Заранее спасибо.

8

1 ответ на вопрос

0
Xen2050

I'm not sure what the official reasons are for having many different variables, most likely different window & display managers all do their own particular configurations.

But all of them look the same, so using any one should work...

Here's what Mint's XFCE has:

$ echo $DESKTOP_SESSION xfce $ echo $XDG_SESSION_DESKTOP xfce $ echo $XDG_CURRENT_DESKTOP XFCE 

and also

$ echo $SESSION xfce $ echo $MDMSESSION xfce $ echo $GDMSESSION xfce 

Or (from env):

XDG_MENU_PREFIX=xfce- UPSTART_JOB=startxfce4 

Your best bet (if you've got wmctrl) may be this combined with grep/cut:

$ wmctrl -m Name: Xfwm4 Class: xfwm4 PID: 5449 Window manager's "showing the desktop" mode: N/A 

You can also be using a different Window Manager and Display Manager, and some different distributions store data in different places, so confusion reigns supreme. See these very related Q's:

Похожие вопросы