• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Linux How to find out the session type: Wayland or Xorg?

dEEpEst

☣☣ In The Depths ☣☣
Staff member
Administrator
Super Moderator
Hacker
Specter
Crawler
Shadow
Joined
Mar 29, 2018
Messages
13,861
Solutions
4
Reputation
32
Reaction score
45,552
Points
1,813
Credits
55,350
‎7 Years of Service‎
 
56%
How to find out the session type: Wayland or Xorg?

Many popular distributions already use Wayland by default. However, Wayland still has problems. Many old programs are not supported or work poorly.

If you have any problems with older programs, you need to check what display server you are using. There are several ways to do this.

The easiest way to see which display server is currently in use is to display the contents of the XDG_SESSION_TYPE environment variable:


Bash:
$ echo $XDG_SESSION_TYPE
wayland




You can also find out the type of the current session using loginctl . To do this, you first need to list the active sessions using list-sessions :




Bash:
$ loginctl list-sessions

SESSION UID USER SEAT TTY
3 1000 parallels seat0 tty2
c1 127 gdm seat0 tty1

2 sessions listed.


Then we display the type of a specific session using the show-session option:




Bash:
$ loginctl show-session 3 -p Type
Type=wayland


Or you can do it all with one command, getting the session ID from the XDG_SESSION_ID environment variable (if defined):


Bash:
$ loginctl show-session "$XDG_SESSION_ID" -p Type
 
Back
Top