https://wiki.archlinux.org/api.php?action=feedcontributions&user=Striped+Monkey&feedformat=atomArchWiki - User contributions [en]2024-03-28T17:37:04ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Display_manager&diff=635607Display manager2020-09-17T21:41:13Z<p>Striped Monkey: Note that there is a second folder, wayland-sessions for wayland specific sessions outside of `/usr/share/xsessions`.</p>
<hr />
<div>[[Category:Graphical user interfaces]]<br />
[[Category:Lists of software]]<br />
[[ar:Display manager]]<br />
[[cs:Display manager]]<br />
[[de:Login-Manager]]<br />
[[es:Display manager]]<br />
[[fa:Display manager]]<br />
[[fr:Gestionnaire de connexions]]<br />
[[he:Display manager]]<br />
[[it:Display manager]]<br />
[[ja:ディスプレイマネージャ]]<br />
[[pt:Display manager]]<br />
[[ru:Display manager]]<br />
[[zh-hans:Display manager]]<br />
[[zh-hant:Display manager]]<br />
{{Related articles start}}<br />
{{Related|Start X at login}}<br />
{{Related articles end}}<br />
<br />
A [[Wikipedia:X display manager (program type)|display manager]], or login manager, is typically a graphical user interface that is displayed at the end of the boot process in place of the default shell. There are various implementations of display managers, just as there are various types of [[window managers]] and [[desktop environments]]. There is usually a certain amount of customization and themeability available with each one.<br />
<br />
== List of display managers ==<br />
<br />
=== Console ===<br />
<br />
* {{App|[[CDM]]|Ultra-minimalistic, yet full-featured login manager written in Bash.|https://github.com/evertiro/cdm|{{AUR|cdm}}}}<br />
* {{App|[[Console TDM]]|Extension for ''xinit'' written in pure Bash.|https://github.com/dopsi/console-tdm|{{AUR|console-tdm}}}}<br />
* {{App|[[nodm]]|Minimalistic display manager for automatic logins, unmaintained since 2017.|https://github.com/spanezz/nodm|{{Pkg|nodm}}}}<br />
* {{App|Ly|Experimental ncurses display manager.|https://github.com/cylgom/ly|{{AUR|ly}}}}<br />
* {{App|tbsm|A pure bash session or application launcher. Supports X and Wayland sessions.|https://loh-tar.github.io/tbsm/|{{AUR|tbsm}}}}<br />
* {{App|emptty|Dead simple CLI Display Manager on TTY with X and Wayland support.|https://github.com/tvrzna/emptty/|{{AUR|emptty-git}}}}<br />
<br />
=== Graphical ===<br />
<br />
* {{App|[[Entrance]]|[[Enlightenment]] display manager.|https://github.com/Obsidian-StudiosInc/entrance|{{AUR|entrance-git}}}}<br />
* {{App|[[GDM]]|[[GNOME]] display manager.|https://wiki.gnome.org/Projects/GDM|{{Pkg|gdm}}}}<br />
* {{App|[[LightDM]]|Cross-desktop display manager, can use various front-ends written in any toolkit.|https://github.com/CanonicalLtd/lightdm/|{{Pkg|lightdm}}}}<br />
* {{App|[[LXDM]]|[[LXDE]] display manager. Can be used independent of the LXDE desktop environment.|https://sourceforge.net/projects/lxdm/|{{Pkg|lxdm}}}}<br />
* {{App|[[SDDM]]|QML-based display manager and successor to KDM; recommended for [[Plasma]] and [[LXQt]].|https://github.com/sddm/sddm|{{Pkg|sddm}}}}<br />
* {{App|[[XDM]]|X display manager with support for XDMCP, host chooser.|{{man|8|xdm}}|{{Pkg|xorg-xdm}}}}<br />
<br />
=== Login daemons ===<br />
<br />
* {{App|[[greetd]]|Minimal, flexible and agnostic login daemon which supports both console and graphical greeters.|https://git.sr.ht/~kennylevinsen/greetd|{{AUR|greetd-git}}}}<br />
<br />
== Loading the display manager ==<br />
<br />
To enable graphical login, [[enable]] the appropriate systemd service. For example, for [[SDDM]], enable {{ic|sddm.service}}.<br />
<br />
This should work out of the box. If not, you might have to reset a custom {{ic|default.target}} symlink to point to the default {{ic|graphical.target}}. See [[systemd#Change default target to boot into]].<br />
<br />
After enabling [[SDDM]] a symlink {{ic|display-manager.service}} should be set in {{ic|/etc/systemd/system/}}. You may need to use {{ic|--force}} to override old symlinks.<br />
<br />
{{hc|$ file /etc/systemd/system/display-manager.service|<br />
/etc/systemd/system/display-manager.service: symbolic link to /usr/lib/systemd/system/sddm.service<br />
}}<br />
<br />
=== Using systemd-logind ===<br />
<br />
In order to check the status of your user session, you can use ''loginctl''. All [[polkit]] actions like suspending the system or mounting external drives will work out of the box.<br />
<br />
$ loginctl show-session $XDG_SESSION_ID<br />
<br />
== Session configuration ==<br />
<br />
Many display managers read available sessions from {{ic|/usr/share/xsessions/}} directory. It contains standard [https://specifications.freedesktop.org/desktop-entry-spec/latest/ desktop entry files] for each DM/WM. Some display managers use a separate {{ic|/usr/share/wayland-sessions/}} to list wayland-specific sessions.<br />
<br />
To add/remove entries to your display manager's session list; create/remove the ''.desktop'' files in {{ic|/usr/share/xsessions/}} as desired. A typical ''.desktop'' file will look something like:<br />
<br />
[Desktop Entry]<br />
Name=Openbox<br />
Comment=Log in using the Openbox window manager (without a session manager)<br />
Exec=/usr/bin/openbox-session<br />
TryExec=/usr/bin/openbox-session<br />
Icon=openbox.png<br />
Type=Application<br />
<br />
===Run ~/.xinitrc as a session===<br />
Installing {{AUR|xinit-xsession}} will provide an option to run your [[xinitrc]] as a session. Simply set {{ic|xinitrc}} as the session in your display manager's settings and make sure that the {{ic|~/.xinitrc}} file is executable.<br />
<br />
=== Starting applications without a window manager ===<br />
<br />
You can also launch an application without any decoration, desktop, or window management. For example to launch {{AUR|google-chrome}} create a {{ic|web-browser.desktop}} file in {{ic|/usr/share/xsessions/}} like this:<br />
<br />
[Desktop Entry]<br />
Name=Web Browser<br />
Comment=Use a web browser as your session<br />
Exec=/usr/bin/google-chrome --auto-launch-at-startup<br />
TryExec=/usr/bin/google-chrome --auto-launch-at-startup<br />
Icon=google-chrome<br />
Type=Application<br />
<br />
In this case, once you login, the application set with {{ic|Exec}} will be launched immediately. When you close the application, you will be taken back to the login manager (same as logging out of a normal DE/WM).<br />
<br />
It is important to remember that most graphical applications are not intended to be launched this way and you might have manual tweaking to do or limitations to live with (there is no window manager, so do not expect to be able to move or resize ''any'' windows, including dialogs; nonetheless, you might be able to set the window geometry in the application's configuration files).<br />
<br />
See also [[xinitrc#Starting applications without a window manager]].<br />
<br />
== Tips and tricks ==<br />
<br />
=== Autostarting ===<br />
<br />
Most display managers source {{ic|/etc/xprofile}}, {{ic|~/.xprofile}} and {{ic|/etc/X11/xinit/xinitrc.d/}}. For more details, see [[xprofile]].<br />
<br />
=== Set language for user session ===<br />
<br />
For display managers that use [https://freedesktop.org/wiki/Software/AccountsService/ AccountsService] the [[locale]] for the user session can be set by editing:{{hc|/var/lib/AccountsService/users/$USER|2=<br />
[User]<br />
Language=''your_locale''}}<br />
<br />
where ''your_locale'' is a value such as {{ic|en_GB.UTF-8}}.<br />
<br />
Log out and then back in again for the changes to take effect.</div>Striped Monkeyhttps://wiki.archlinux.org/index.php?title=NVIDIA_Optimus&diff=583602NVIDIA Optimus2019-09-22T06:12:51Z<p>Striped Monkey: Fix a small typo because it bugged me</p>
<hr />
<div>[[Category:Graphics]]<br />
[[ja:NVIDIA Optimus]]<br />
[[ru:NVIDIA Optimus]]<br />
[[zh-hans:NVIDIA Optimus]]<br />
{{Related articles start}}<br />
{{Related|Bumblebee}}<br />
{{Related|Nouveau}}<br />
{{Related|NVIDIA}}<br />
{{Related|nvidia-xrun}}<br />
{{Related articles end}}<br />
<br />
[[Wikipedia:NVIDIA Optimus|NVIDIA Optimus]] is a technology that allows an Intel integrated GPU and discrete NVIDIA GPU to be built into and accessed by a laptop.<br />
<br />
== Available methods ==<br />
<br />
There are several methods available:<br />
<br />
* [[#Use Intel graphics only]] - saves power, because NVIDIA GPU will be completely powered off.<br />
* [[#Use NVIDIA graphics only]] - gives more performance than Intel graphics, but drains more battery (which is not welcome for mobile devices). This utilizes the same underlying process as the [[#Using optimus-manager|optimus-manager]] and [[#Using nvidia-xrun|nvidia-xrun]] options, it should be utilized for troubleshooting and verifying general functionality, before opting for one of the more automated approaches.<br />
* Using both (use NVIDIA GPU when needed and keep it powered off to save power):<br />
** [[#Using optimus-manager]] - switches graphics with a single command (logout and login required to take effect). It achieves maximum performance out of NVIDIA GPU and switches it off if not in use.<br />
** [[#Using nvidia-xrun]] - run separate X session on different TTY with NVIDIA graphics. It achieves maximum performance out of NVIDIA GPU and switches it off if not in use.<br />
** [[#Using Bumblebee]] - provides Windows-like functionality by allowing to run selected applications with NVIDIA graphics while using Intel graphics for everything else. Has significant performance issues.<br />
** [[#Using nouveau]] - offers poorer performance (compared to the proprietary NVIDIA driver) and may cause issues with sleep and hibernate. Does not work with latest NVIDIA GPUs.<br />
<br />
{{Note|All of these options are mutually exclusive, if you test one approach and decide for another, you must ensure to revert any configuration changes done by following one approach before attempting another method, otherwise file conflicts and undefined behaviours may arise.}}<br />
<br />
== Use Intel graphics only ==<br />
<br />
If you only care to use a certain GPU without switching, check the options in your system's BIOS. There should be an option to disable one of the cards. Some laptops only allow disabling of the discrete card, or vice-versa, but it is worth checking if you only plan to use just one of the cards.<br />
<br />
If your BIOS does not allow to disable Nvidia graphics, you can disable it from the Linux itself. See [[Hybrid graphics#Fully Power Down Discrete GPU]].<br />
<br />
== Use NVIDIA graphics only ==<br />
<br />
The proprietary NVIDIA driver does not support dynamic switching like the nouveau driver (meaning it can only use the NVIDIA device). It also has notable screen-tearing issues that NVIDIA recognizes but has not fixed, unless you are using x.org > 1.19 and enable prime sync, see [https://devtalk.nvidia.com/default/topic/957814/linux/prime-and-prime-synchronization/]. However, it does allow use of the discrete GPU and has (as of [https://www.phoronix.com/scan.php?page=article&item=nouveau-410-blob&num=1 January 2017]) a marked edge in performance over the nouveau driver.<br />
<br />
First, [[install]] the [[NVIDIA]] driver and {{Pkg|xorg-xrandr}}. Then, configure {{ic|xorg.conf}}. You will need to know the PCI address of the NVIDIA card, which you can find by issuing<br />
<br />
$ lspci | egrep 'VGA|3D'<br />
<br />
The PCI address is the first 7 characters of the line that mentions NVIDIA. It will look something like {{ic|01:00.0}}. In the {{ic|xorg.conf}}, you will need to format it as {{ic|#:#:#}} while converting hexadecimal numbers to decimal numbers; e.g. {{ic|01:00.0}} would be formatted as {{ic|1:0:0}}.<br />
<br />
{{Note|On some setups this setup breaks automatic detection of the values of the display by the nvidia driver through the EDID file. As a work-around see [[#Resolution, screen scan wrong. EDID errors in Xorg.log]]. }}<br />
If X.Org X server version 1.17.2 or higher is installed ([http://us.download.nvidia.com/XFree86/Linux-x86/358.16/README/randr14.html])<br />
{{hc|/etc/X11/xorg.conf|<br />
Section "Module"<br />
Load "modesetting"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "nvidia"<br />
Driver "nvidia"<br />
BusID "PCI:'''<BusID for NVIDIA device here>'''"<br />
Option "AllowEmptyInitialConfiguration"<br />
EndSection<br />
}}<br />
<br />
Next, add the following two lines to the beginning of your {{ic|~/.xinitrc}}:<br />
<br />
{{hc|~/.xinitrc|<br />
xrandr --setprovideroutputsource modesetting NVIDIA-0<br />
xrandr --auto<br />
}}<br />
<br />
Now reboot to load the drivers, and X should start.<br />
<br />
If your display dpi is not correct add the following line:<br />
<br />
xrandr --dpi 96<br />
<br />
If you get a black screen when starting X, make sure that there are no ampersands after the two {{ic|xrandr}} commands in {{ic|~/.xinitrc}}. If there are ampersands, it seems that the window manager can run before the {{ic|xrandr}} commands finish executing, leading to a black screen. <br />
<br />
=== Display managers ===<br />
<br />
If you are using a display manager then you will need to create or edit a display setup script for your display manager instead of using {{ic|~/.xinitrc}}.<br />
<br />
==== LightDM ====<br />
<br />
For the [[LightDM]] display manager:<br />
<br />
{{hc|/etc/lightdm/display_setup.sh|<br />
#!/bin/sh<br />
xrandr --setprovideroutputsource modesetting NVIDIA-0<br />
xrandr --auto<br />
}}<br />
<br />
Make the script executable:<br />
<br />
# chmod +x /etc/lightdm/display_setup.sh<br />
<br />
Now configure lightdm to run the script by editing the {{ic|[Seat:*]}} section in {{ic|/etc/lightdm/lightdm.conf}}:<br />
<br />
{{hc|/etc/lightdm/lightdm.conf|output=<br />
[Seat:*]<br />
display-setup-script=/etc/lightdm/display_setup.sh<br />
}}<br />
<br />
Now reboot and your display manager should start.<br />
<br />
==== SDDM ====<br />
For the [[SDDM]] display manager (SDDM is the default DM for [[KDE]]):<br />
<br />
{{hc|/usr/share/sddm/scripts/Xsetup|<br />
xrandr --setprovideroutputsource modesetting NVIDIA-0<br />
xrandr --auto<br />
}}<br />
<br />
==== GDM ====<br />
<br />
For the [[GDM]] display manager create two new .desktop files:<br />
<br />
{{hc|/usr/share/gdm/greeter/autostart/optimus.desktop<br />
/etc/xdg/autostart/optimus.desktop|<br />
<nowiki>[Desktop Entry]<br />
Type=Application<br />
Name=Optimus<br />
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto"<br />
NoDisplay=true<br />
X-GNOME-Autostart-Phase=DisplayServer</nowiki><br />
}}<br />
<br />
Make sure that GDM use [[GDM#Use_Xorg_backend|X as default backend]].<br />
<br />
=== Checking 3D ===<br />
<br />
You can check if the NVIDIA graphics are being used by installing {{Pkg|mesa-demos}} and running<br />
<br />
$ glxinfo | grep NVIDIA<br />
<br />
=== Further Information ===<br />
<br />
For more information, look at NVIDIA's official page on the topic [http://us.download.nvidia.com/XFree86/Linux-x86/370.28/README/randr14.html].<br />
<br />
== Troubleshooting ==<br />
<br />
{{Style|If this is relevant only for [[#Use NVIDIA graphics only]], it should be a subsection. Otherwise it should be the last section on the page.}}<br />
<br />
=== Tearing/Broken VSync ===<br />
<br />
This requires {{pkg|xorg-server}} 1.19 or higher, {{pkg|linux}} kernel 4.5 or higher, and {{pkg|nvidia}} 370.23 or higher. Then enable [[NVIDIA#DRM_kernel_mode_setting|DRM kernel mode setting]], which will in turn enable the PRIME synchronization and fix the tearing.<br />
<br />
You can read the official [https://devtalk.nvidia.com/default/topic/957814/linux/prime-and-prime-synchronization/ forum thread] for details.<br />
<br />
=== Failed to initialize the NVIDIA GPU at PCI:1:0:0 (GPU fallen off the bus / RmInitAdapter failed!) ===<br />
<br />
Add {{ic|1=rcutree.rcu_idle_gp_delay=1}} to the kernel parameters. Original topic can be found in [https://github.com/Bumblebee-Project/Bumblebee/issues/455#issuecomment-22497464] and [https://bbs.archlinux.org/viewtopic.php?id=169742].<br />
<br />
=== Resolution, screen scan wrong. EDID errors in Xorg.log ===<br />
<br />
This is due to the NVIDIA driver not detecting the EDID for the display. You need to manually specify the path to an EDID file or provide the same information in a similar way.<br />
<br />
To provide the path to the EDID file edit the Device Section for the NVIDIA card in Xorg.conf, adding these lines and changing parts to reflect your own system:<br />
<br />
{{hc|/etc/X11/xorg.conf|<br />
Section "Device"<br />
Option "ConnectedMonitor" "CRT-0"<br />
Option "CustomEDID" "CRT-0:/sys/class/drm/card0-LVDS-1/edid"<br />
Option "IgnoreEDID" "false"<br />
Option "UseEDID" "true"<br />
EndSection<br />
}}<br />
<br />
If Xorg wont start try swapping out all references of CRT to DFB.<br />
card0 is the identifier for the intel card to which the display is connected via LVDS. The edid binary is in this directory. If the hardware arrangement is different, the value for CustomEDID might vary but yet this has to be confirmed. The path will start in any case with /sys/class/drm.<br />
<br />
Alternatively you can generate your edid with tools like {{Pkg|read-edid}} and point the driver to this file. Even modelines can be used, but then be sure to change "UseEDID" and "IgnoreEDID".<br />
<br />
=== Wrong resolution without EDID errors ===<br />
Using ''nvidia-xconfig'', incorrect information might be generated in Xorg.conf and in particular wrong monitor refresh rates that restruct the possible resolutions. Try commenting out the {{ic|HorizSync}}/{{ic|VertRefresh}} lines. If this helps, you can probably also remove everything else not mentioned in this article.<br />
<br />
=== Lockup issue (lspci hangs) ===<br />
Symptoms: lspci hangs, system suspend fails, shutdown hangs, optirun hangs.<br />
<br />
Applies to: newer laptops with GTX 965M or alike when bbswitch (e.g. via Bumblebee) or nouveau is in use.<br />
<br />
When the dGPU power resource is turned on, it may fail to do so and hang in ACPI code ([https://bugzilla.kernel.org/show_bug.cgi?id=156341 kernel bug 156341]).<br />
<br />
For known model-specific workarounds, see [https://github.com/Bumblebee-Project/Bumblebee/issues/764#issuecomment-234494238 this issue].<br />
In other cases you can try to boot with {{ic|1=acpi_osi="!Windows 2015"}} or {{ic|1=acpi_osi=! acpi_osi="Windows 2009"}} added to your [[Kernel parameters]]. (Consider reporting your laptop to that issue.)<br />
<br />
=== No screens found on a laptop/NVIDIA Optimus ===<br />
<br />
Check if {{ic|<nowiki>$ lspci | grep VGA</nowiki>}}<br />
outputs something similar to:<br />
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 02)<br />
01:00.0 VGA compatible controller: nVidia Corporation Device 0df4 (rev a1)<br />
<br />
NVIDIA drivers now offer Optimus support since 319.12 Beta [http://www.nvidia.com/object/linux-display-amd64-319.12-driver.html] with kernels above and including 3.9.<br />
<br />
Another solution is to install the [[Intel]] driver to handle the screens, then if you want 3D software you should run them through [[Bumblebee]] to tell them to use the NVIDIA card.<br />
<br />
== Use switchable graphics ==<br />
<br />
=== Using nouveau ===<br />
<br />
See [[PRIME]] for graphics switching and [[nouveau]] for open-source NVIDIA driver.<br />
<br />
=== Using Bumblebee ===<br />
<br />
See [[Bumblebee]].<br />
<br />
=== Using nvidia-xrun ===<br />
<br />
See [[nvidia-xrun]].<br />
<br />
=== Using optimus-manager ===<br />
<br />
[https://github.com/Askannz/optimus-manager Optimus-manager] is one of the easiest solutions for graphics switching between Nvidia and Intel with a single command. Graphical systray applet is also available.<br />
<br />
==== Installation ====<br />
<br />
Install the required [[NVIDIA]] driver and {{AUR|optimus-manager}}. Optionally install {{pkg|bbswitch}} for power saving and {{AUR|optimus-manager-qt}} for system tray applet.<br />
<br />
Also [[Systemd#Using_units|start and enable]] {{ic|optimus-manager.service}}.<br />
<br />
==== Usage ====<br />
<br />
{{Note|Switching graphics will log you out automatically. Log in again to use selected graphics.}}<br />
<br />
Use below commands to switch graphics:<br />
$ optimus-manager --switch intel # Use Intel graphics<br />
$ optimus-manager --switch nvidia # Use NVIDIA graphics<br />
$ optimus-manager --switch auto # Switch to different graphics (from what is used now)<br />
<br />
Also specify which graphics to use on boot:<br />
$ optimus-manager --set-startup intel<br />
$ optimus-manager --set-startup nvidia<br />
<br />
For more information and troubleshooting, see [https://github.com/Askannz/optimus-manager/blob/master/README.md upstream documentation].</div>Striped Monkey