Linux узнать display manager

Find Out Which Display-Manager You’re Using

In today’s article, we’re going to help you find out which display-manager you’re using. Your display-manager is an easy thing to change, but you should probably know which display-manager you’re using before you go about trying to change it. Either way, this article isn’t about changing your display-manager, it’s about finding out which one you’re using.

Sure, you could use a search engine and find out what the default display-manger is for your distro of choice, but where’s the fun in that? There are a few ways, some distro-specific, to find out which display-manager you’re using.

So, what is this ‘display-manager’? Well, a display-manager is often called a ‘login-manager’, and that’s actually a better name for it. It’s the (usually graphical) bit that shows up at the end of your boot process. It’s where you type in your username and password, and can sometimes make some other choices like keyboard layout.

The display-manager is a bit more than that, behind the scenes. It does things like manage authentication and manage user sessions. You can do all these things from the terminal, but your display-manager will let you do that graphically while not having to worry about anything deeper than that.

I guess it’s worth knowing which display-manager you’re using. After all, you might not want to change it, you might be having some issues with it and need to know which one you’re using so that you can start digging into solutions. I’m sure there are all sorts of reasons why you’d want to know this information. So, without further ado…

Find Out Which Display-Manager You’re Using:

Like many other articles on this site, this one requires an open terminal. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Once you have your terminal open, you can try one of the following (because this data is stored in different places on different distros):

Debian/Ubuntu/etc:

Источник

Есть ли простая команда Linux, которая скажет мне, что мой менеджер дисплеев?

Есть ли простая команда Linux, которая скажет мне, что мой менеджер дисплеев?

Читайте также:  Linux remove package with dependencies

Я использую Xfce. Разные среды рабочего стола обычно связаны с разными дисплеями?

К сожалению, конфигурация отличается для каждого дистрибутива:

/etc/X11/default-display-manager 

RedHat (должен также применяться к Fedora)

/etc/sysconfig/displaymanager 

Предположим, я не знаю, что такое мой менеджер дисплеев, и я хочу выяснить это с помощью терминала. Как бы я это сделал?

@ptrcao Вы бы заглянули в эти файлы. Либо открыв их в вашем любимом редакторе, либо просто делаю cat .

Нет Диспетчер отображения не обязательно связан с чем-либо еще, работающим на том же X-сервере. Диспетчер отображения запускается до входа в систему; это выбирает системный администратор. Все остальное (оконный менеджер, менеджер сессий, среда рабочего стола и т. Д.) Выбирается пользователем. Диспетчер дисплеев даже не требуется: если вы входите в текстовый режим и запускаете графический интерфейс с помощью startx , диспетчер дисплеев не задействуется.

Вы можете проверить, какой менеджер дисплеев по умолчанию используется в вашей системе . Это даст правильный ответ только при некоторых общих, но не универсальных предположениях. Если по какой-либо причине вы вручную запустили другой менеджер, этот метод не скажет вам.

Хорошая ставка — узнать идентификатор процесса X-сервера: его родительский процесс, вероятно, является диспетчером отображения, если он есть. Это требует, чтобы ваши клиенты работали на той же машине, что и X-сервер. lsof /tmp/.X11-unix/X$ покажет процесс X-сервера (при условии, что сокеты X живут в /tmp/.X11-unix ).

x=$(lsof -F '' /tmp/.X11-unix/X0); x=$ ps -p $(ps -o ppid -p $x) 

(Объяснение: lsof -F » печатает вывод как p1234 . -F Опция означает машинно-разборчивый формат вывода и » означает печатать только PID с буквой p перед ним. x=$ Удаляет начальную букву p . Последняя строка получает PID родителя X-сервера ( ps -o ppid -p $x ) и вызывает, ps чтобы показать информацию об этом родительском процессе.)

Некоторые дистрибутивы позволяют устанавливать несколько дисплеев дисплеев. Там будет только один работающий, если у вас нет системы на несколько мест. Чтобы вывести список всех установленных пакетов диспетчера отображения в Debian и его производных:

aptitude -F %p search '~i ~P^x-display-manager$' 

Источник

How to check using the command line which display manager is running?

i do not want to be excluded from discussion because of my lexical disabilities, i asked for the display manager, the link you gave me is about the window manager.

2 Answers 2

As mentioned in this answer on Unix & Linux, you should be able to get that from:

cat /etc/X11/default-display-manager 

I tried it on both Unity and XFCE , both worked.

Result of screenfetch and neofetch

Other way to find more detailed information about the window manager you’re using is by running either neofetch or screenfetch . Both are similar and are available in Debian repositories. I install Neofetch and it show my WM also to be WM: Mutter.

Читайте также:  Аналог эксель на линуксе

you can install them in debian systems CLI by :

sudo apt install neofetch screenfetch 

You must log in to answer this question.

Linked

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

Site design / logo © 2023 Stack Exchange Inc; user contributions licensed under CC BY-SA . rev 2023.7.14.43533

Ubuntu and the circle of friends logo are trade marks of Canonical Limited and are used under licence.

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Источник

How to get name of Display Manager on Linux? [duplicate]

«GUI» is a bit vague. Are you interested in your desktop environment, your window manager or your display manager? For finding out the session manager on Debian, for example, you can use readlink /etc/alternatives/x-session-manager but this is definitely not portable (doesn’t work on Fedora).

You can try [ xwininfo -id $(xprop -root | awk ‘/_NET_ACTIVE_WINDOW\(WINDOW\)/‘) ][1] for the current window. [1]: askubuntu.com/a/20534/10371

How do you plan to select the application if you don’t know it’s name? Is it a GUI that Python or Bash would’ve started up initially? xwininfo can give you information about the various GUI’s running.

I want to install a package according to the type of GUI via script. My script must know the GUI name. Thus I asked the question.

2 Answers 2

You may probably check the environment variable named DESKTOP_SESSION .

This seems to work well enough. Interestingly, though, I tried it in a root terminal (after su ) and it was unset.

@JosephR. that is probably because the root user has not started any Desktop Session, it is your user who has launched it.

@Marco it should contain the desktop name choosen by the user at login time. If the content is default , then I think, it gets the first one in /usr/share/xsessions .

As @eppesuig has said, the environment variable DESKTOP_SESSION may tell you the currently running session.

But that doesn’t mean it is the only – or even normal – Desktop environment in use on that system. I usually use GNOME3, but sometimes I boot into KDE or Enlightenment.

If the point of this is to select a desktop-specific GUI package for installation, this really should be used to suggest a default option rather than making a firm decision. If I happened to be running KDE when I installed your app, I would be disappointed to discover I had only installed a QT interface if a GTK interface was available.

Источник

Is there a simple linux command that will tell me what my display manager is?

Is there a simple linux command that will tell me what my display manager is? I’m using Xfce. Are different desktop environments usually affiliated with different display managers?

Читайте также:  Сертификат соответствия dr web linux

12 Answers 12

Unfortunately the configuration differs for each distribution:

Debian/Ubuntu

/etc/X11/default-display-manager 

RedHat & Fedora

OpenSuSe

/etc/sysconfig/displaymanager 

Suppose I don’t know what my display manager is and I want to find out by using terminal. How would I do that?

@ptrcao You would look into those files. Either opening them in your favorite editor, or just doing cat .

If you are using a systemd based distribution, this command will give the name of the display manger currently configured because you may have more than one display manager installed.

grep 'ExecStart=' /etc/systemd/system/display-manager.service 

Output will be something like

Looks like I am using mint display manager.

If you’re using systemd, then

systemctl status display-manager 

Will display the name and status of the active display manager service on your machine.

There isn’t. The display manager is not necessarily related to anything else that’s running on the same X server. The display manager runs before you log in; it’s chosen by the system administrator. Everything else (window manager, session manager, desktop environment, …) is chosen by the user. There doesn’t even have to be a display manager: if you log in in text mode and start the GUI with startx , no display manager is involved.

You can check which display manager is the default one on your system. This will only give the right answer under some common but not universal assumptions. If you manually ran a different manager for whatever reason, this method won’t tell you.

A good bet is to find out the process ID of the X server: its parent process is probably a display manager, if there is one. This requires that your clients are running on the same machine as the X server. lsof /tmp/.X11-unix/X$ will show the X server process (assuming the X sockets live in /tmp/.X11-unix ).

x=$(lsof -F '' /tmp/.X11-unix/X0); x=$ ps -p $(ps -o ppid -p $x) 

(Explanation: lsof -F » prints output like p1234 . The -F option means a machine-parseable output format, and » means to only print the PID, with the letter p before it. x=$ strips off the initial letter p . The last line obtains the PID of the parent of the X server ( ps -o ppid -p $x ), and calls ps to show information about that parent process.)

Some distributions allow installing multiple display managers. There’ll only be a single one running unless you have a multiseat system though. To list all installed display manager packages under Debian and derivatives:

aptitude -F %p search '~i ~P^x-display-manager$' 

Источник

Оцените статью
Adblock
detector