Difference between revisions of "GDM"

From ArchWiki
Jump to: navigation, search
(GDM uses Wayland now (but falls back on X))
 
(190 intermediate revisions by 40 users not shown)
Line 1: Line 1:
 
[[Category:Display managers]]
 
[[Category:Display managers]]
 +
[[Category:GNOME]]
 
[[es:GDM]]
 
[[es:GDM]]
 +
[[ja:GDM]]
 
[[pt:GDM]]
 
[[pt:GDM]]
 
[[zh-CN:GDM]]
 
[[zh-CN:GDM]]
{{Article summary start}}
+
{{Related articles start}}
{{Article summary text|GDM is the GNOME Display Manager, a graphical login program. This article covers its installation and configuration.}}
+
{{Related|GNOME}}
{{Article summary heading|Related}}
+
{{Related|GNOME Flashback}}
{{Article summary wiki|Display Manager}}
+
{{Related|Display manager}}
{{Article summary wiki|GNOME}}
+
{{Related|LightDM}}
{{Article summary end}}
+
{{Related|LXDM}}
 +
{{Related articles end}}
 +
From [https://wiki.gnome.org/Projects/GDM GDM - GNOME Display Manager]: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins."
  
From [http://projects.gnome.org/gdm/about.html GDM - GNOME Display Manager]:
+
[[Display manager]]s provide [[X Window System]] and [[Wayland]] users with a graphical login prompt.
  
:''GDM is the GNOME Display Manager, it is the little program that runs in the background, runs your X sessions, presents you with a login box and then tells you to bug off because you forgot your password. It does pretty much everything that you would want to use xdm for, but does not involve as much crack. It does not use any code from xdm. It supports XDMCP, and in fact extends XDMCP a little bit in places where I thought xdm was lacking (but is still compatible with xdm's XDMCP).''
+
== Installation ==
  
[[Display manager]]s provide [[X Window System]] users with a graphical login prompt.
+
GDM can be [[installed]] with the {{Pkg|gdm}} package, and it is installed as part of the {{grp|gnome}} group. To start GDM at boot time [[enable]] {{ic|gdm.service}}.
  
==Installation==
+
If you would prefer to use legacy GDM which was used in GNOME 2 and has its own configuration utility, install the {{AUR|gdm-old}} package. Note that the rest of this article discusses current GDM, not legacy GDM, unless indicated otherwise.
GDM (which is also part of {{Grp|gnome-extra}}) can be [[Pacman|installed]] with the {{Pkg|gdm}} package, available in the [[Official repositories]].
+
  
=== GDM as the default greeter ===
+
You might also wish to install the following:
To make GDM the default graphical login method for the system, use the packaged systemd service file, {{ic|gdm.service}}. Simply run the following command once to bring up GDM on boot:
+
* {{App|gdm3setup|An interface to configure GDM3, autologin options and change Shell theme|https://github.com/Nano77/gdm3setup|{{AUR|gdm3setup}}}}
# systemctl enable gdm
+
  
The arguments passed to the X server by {{ic|~/.xinitrc}} (such as those of {{ic|xmodmap}} and {{ic|xsetroot}}) can also be added through [[xprofile]]:
+
== Configuration ==
  
{{hc|~/.xprofile|<nowiki>
+
=== Autostarting applications with GDM ===
 +
 
 +
See [[Display manager#Autostarting]]. Note that adding scripts to {{ic|/etc/gdm/Init}} no longer works, see the [https://bugzilla.gnome.org/show_bug.cgi?id=751602 upstream bug report].
 +
 
 +
=== Log-in screen background image ===
 +
 
 +
{{Note|Since GNOME 3.16, GNOME Shell themes are now stored binary files (gresource).}}
 +
 
 +
Firstly, you need to extract the existing GNOME Shell theme to a folder in your home directory. You can do this using the following script:
 +
 
 +
{{hc|extractgst.sh|2=
 
#!/bin/sh
 
#!/bin/sh
  
#
+
workdir=${HOME}/shell-theme
# ~/.xprofile
+
if [ ! -d ${workdir}/theme ]; then
#
+
  mkdir -p ${workdir}/theme
# Executed by gdm at login
+
fi
#
+
gst=/usr/share/gnome-shell/gnome-shell-theme.gresource
  
xmodmap -e "pointer=1 2 3 6 7 4 5" # set mouse buttons up correctly
+
for r in `gresource list $gst`; do
xsetroot -solid black              # sets the background to black
+
        gresource extract $gst $r >$workdir${r/#\/org\/gnome\/shell/}
</nowiki>}}
+
done}}
  
==Configuration==
+
Navigate to the created directory. You should find that the theme files have been extracted to it. Now copy your preferred background image to this directory.
You can no longer use the gdmsetup command to configure GDM as of version 2.28. The command has been removed and GDM has been standardized and integrated with the rest of GNOME.
+
  
You can install {{aur|gdm3setup}} from the AUR to configure GDM, or use the following instructions.
+
Next, you need to create a file in the directory with the following content:
  
Configure X server access permission:
+
{{hc|gnome-shell-theme.gresource.xml|2=
{{bc|# xhost +SI:localuser:gdm}}
+
<?xml version="1.0" encoding="UTF-8"?>
 +
<gresources>
 +
  <gresource prefix="/org/gnome/shell/theme">
 +
    <file>calendar-arrow-left.svg</file>
 +
    <file>calendar-arrow-right.svg</file>
 +
    <file>calendar-today.svg</file>
 +
    <file>checkbox-focused.svg</file>
 +
    <file>checkbox-off-focused.svg</file>
 +
    <file>checkbox-off.svg</file>
 +
    <file>checkbox.svg</file>
 +
    <file>close-window.svg</file>
 +
    <file>close.svg</file>
 +
    <file>corner-ripple-ltr.png</file>
 +
    <file>corner-ripple-rtl.png</file>
 +
    <file>dash-placeholder.svg</file>
 +
    <file>filter-selected-ltr.svg</file>
 +
    <file>filter-selected-rtl.svg</file>
 +
    <file>gnome-shell.css</file>
 +
    <file>gnome-shell-high-contrast.css</file>
 +
    <file>logged-in-indicator.svg</file>
 +
    <file>'''filename'''</file>
 +
    <file>more-results.svg</file>
 +
    <file>no-events.svg</file>
 +
    <file>no-notifications.svg</file>
 +
    <file>noise-texture.png</file>
 +
    <file>page-indicator-active.svg</file>
 +
    <file>page-indicator-inactive.svg</file>
 +
    <file>page-indicator-checked.svg</file>
 +
    <file>page-indicator-hover.svg</file>
 +
    <file>process-working.svg</file>
 +
    <file>running-indicator.svg</file>
 +
    <file>source-button-border.svg</file>
 +
    <file>summary-counter.svg</file>
 +
    <file>toggle-off-us.svg</file>
 +
    <file>toggle-off-intl.svg</file>
 +
    <file>toggle-on-hc.svg</file>
 +
    <file>toggle-on-us.svg</file>
 +
    <file>toggle-on-intl.svg</file>
 +
    <file>ws-switch-arrow-up.png</file>
 +
    <file>ws-switch-arrow-down.png</file>
 +
  </gresource>
 +
</gresources>}}
  
Change the theme:
+
Replace '''filename''' with the filename of your background image.
{{bc|$ sudo -u gdm dbus-launch gnome-control-center}}
+
  
For more configuration options, do:
+
Now, open the {{ic|gnome-shell.css}} file in the directory and change the {{ic|#lockDialogGroup}} definition as follows:
{{bc|$ sudo -u gdm dbus-launch gconf-editor}}
+
  
and modify the following hierarchies:
+
#lockDialogGroup {
/apps/gdm/simple-greeter
+
  background: #2e3436 url('''filename''');
/desktop/gnome/interface
+
  background-size: '''[WIDTH]'''px '''[HEIGHT]'''px;
  /desktop/gnome/background
+
  background-repeat: no-repeat;
 +
  }
  
If these commands fail with an error (e.g. {{ic|"Cannot open display"}}) you can bring the two windows up when GDM starts by adding them to GDM's autostart. To do this first create the entry:
+
Set {{ic|background-size}} to the resolution that GDM uses, this might not necessarily be the resolution of the image. For a list of display resolutions see [[wikipedia:Display_resolution#Computer_monitors|Display resolution]]. Again, set '''filename''' to be the name of the background image.
{{bc|# cp -t /usr/share/gdm/autostart/LoginWindow/ /usr/share/applications/gnome-appearance-properties.desktop /usr/share/applications/gconf-editor.desktop}}
+
  
Then go back to GDM, do your changes and log back in. When you're done and want the window to stop opening with GDM run this:
+
Finally, compile the theme using the following command:
{{bc|# rm /usr/share/gdm/autostart/LoginWindow/gnome-appearance-properties.desktop /usr/share/gdm/autostart/LoginWindow/gconf-editor.desktop}}
+
$ glib-compile-resources gnome-shell-theme.gresource.xml
 +
Then copy the resulting {{ic|gnome-shell-theme.gresource}} file to the {{ic|/usr/share/gnome-shell}} directory.
  
{{Note|By using the logout/configure method you can view the changes while you're making them.}}
+
Restart GDM - you should find that it is using your preferred background image.
  
For more information and advanced settings read [http://library.gnome.org/admin/gdm/stable/configuration.html.en this].
+
For more information, please see the following [https://bbs.archlinux.org/viewtopic.php?id&#61;197036 forum thread].
 +
 
 +
=== DConf configuration ===
 +
 
 +
Some GDM settings are stored in a DConf database. They can be configured either by adding ''keyfiles'' to the {{ic|/etc/dconf/db/gdm.d}} directory and then recompiling the GDM database by running {{ic|dconf update}} as root or by logging into the GDM user on the system and changing the setting directly using the ''gsettings'' command line tool. Note that for the former approach, a GDM profile file is required - this must be created manually as it is no longer shipped upstream, see below:
 +
{{hc|/etc/dconf/profile/gdm|
 +
user-db:user
 +
system-db:gdm
 +
file-db:/usr/share/gdm/greeter-dconf-defaults}}
 +
For the latter approach, you can log into the GDM user with the command below:
 +
# machinectl shell gdm@
 +
 
 +
==== Log-in screen logo ====
 +
 
 +
Either create the following keyfile
 +
{{hc|/etc/dconf/db/gdm.d/02-logo|2=
 +
[org/gnome/login-screen]
 +
logo=<nowiki>'</nowiki>''/path/to/logo.png''<nowiki>'</nowiki>}}
 +
and then recompile the GDM database or alternatively log in to the GDM user and execute the following:
 +
$ gsettings set org.gnome.login-screen logo <nowiki>'</nowiki>''/path/to/logo.png''<nowiki>'</nowiki>
 +
 
 +
==== Changing the cursor theme ====
 +
 
 +
GDM disregards [[GNOME]] cursor theme settings and it also ignores the cursor theme set according to the [[Cursor themes#XDG specification|XDG specification]]. To change the cursor theme used in GDM, either create the following keyfile
 +
 
 +
{{hc|/etc/dconf/db/gdm.d/10-cursor-settings|
 +
<nowiki>[org/gnome/desktop/interface]
 +
cursor-theme='</nowiki>''theme-name'''
 +
}}
 +
and then recompile the GDM database or alternatively log in to the GDM user and execute the following:
 +
$ gsettings set org.gnome.desktop.interface cursor-theme <nowiki>'</nowiki>''theme-name''<nowiki>'</nowiki>
 +
 
 +
==== Larger font for log-in screen ====
 +
 
 +
Click on the accessibility icon at the top right of the screen (a white circle with the silhouette of a person in the centre) and check the ''Large Text'' option.
 +
 
 +
To set a specific scaling factor, you can create the following keyfile:
 +
{{hc|/etc/dconf/db/gdm.d/03-scaling|2=
 +
[org/gnome/desktop/interface]
 +
text-scaling-factor=<nowiki>'</nowiki>''1.25''<nowiki>'</nowiki>}}
 +
and then recompile the GDM database or alternatively log in to the GDM user and execute the following:
 +
$ gsettings set org.gnome.desktop.interface text-scaling-factor <nowiki>'</nowiki>''1.25''<nowiki>'</nowiki>
 +
 
 +
==== Turning off the sound ====
 +
 
 +
This tweak disables the audible feedback heard when the system volume is adjusted (via keyboard) on the login screen.
 +
 
 +
Either create the following keyfile:
 +
{{hc|/etc/dconf/db/gdm.d/04-sound|2=
 +
[org/gnome/desktop/sound]
 +
event-sounds='false'}}
 +
and then recompile the GDM database or alternatively log in to the GDM user and execute the following:
 +
$ gsettings set org.gnome.desktop.sound event-sounds 'false'
 +
 
 +
==== Make the power button interactive ====
 +
{{Out of date|Some button-* configuration options are no longer available from GDM 3.18.|section="Make the power button interactive" no longer possible with GDM 3.18}}
 +
The behaviour of the power buttons can be configured in GDM. The example below will configure the power and hibernate buttons to ''Show dialog'':
 +
 
 +
Create the following keyfile:
 +
{{hc|/etc/dconf/db/gdm.d/05-power|2=
 +
[org/gnome/settings-daemon/plugins/power button]
 +
power='interactive'
 +
hibernate='interactive'}}
 +
and then recompile the GDM database.
 +
 
 +
{{Warning|Please note that the [[acpid]] daemon also handles the "power button" and "hibernate button" events. Running both systems at the same time may lead to unexpected behaviour.}}
 +
 
 +
==== Enabling tap-to-click ====
 +
 
 +
Tap-to-click is disabled in GDM (and GNOME) by default, but you can easily enable it with a dconf setting.
 +
 
 +
{{Note|If you want to do this under X, you have to first set up correct X server access permissions - see [[#Configure X server access permission]].}}
 +
 
 +
To directly enable tap-to-click, use:
 +
 
 +
{{bc|# sudo -u gdm gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true}}
 +
 
 +
If you prefer to do this with a GUI, use:
 +
 
 +
{{bc|# sudo -u gdm dconf-editor}}
 +
 
 +
To check the if it was set correctly, use:
 +
 
 +
{{bc|$ sudo -u gdm gsettings get org.gnome.desktop.peripherals.touchpad tap-to-click}}
 +
 
 +
=== GDM keyboard layout ===
 +
 
 +
See [[Keyboard configuration in Xorg#Using X configuration files]].
 +
 
 +
{{Tip|See [[Wikipedia:ISO 3166-1]] for a list of keymaps.}}
 +
 
 +
==== GNOME Control Center ====
 +
 
 +
If the package {{Pkg|gnome-control-center}} is installed, the keyboard layout(s) can be configured using a graphical frontend. Start ''gnome-control-center'' and navigate to ''Keyboard -> Input Sources''. Then, in the header bar, hit the ''Login Screen'' toggle button to configure the keyboard layout for GDM specifically.
 +
 
 +
==== GDM 2.x layout ====
 +
 
 +
Users of legacy GDM may need to follow the instructions below:
 +
 
 +
Edit {{ic|~/.dmrc}}:
 +
 
 +
{{hc|~/.dmrc|2=
 +
[Desktop]
 +
Language=de_DE.UTF-8  # change to your default lang
 +
Layout=de  nodeadkeys # change to your keyboard layout
 +
}}
 +
 
 +
=== Change the language ===
 +
 
 +
To change the GDM language, ensure that {{Pkg|gnome-control-center}} is installed. Then, start ''gnome-control-center'' and choose ''Region & Language''. In the header bar, check the ''Login Screen'' toggle button. Finally, click on ''Language'' and choose your language from the list. You will be prompted for your root password.
 +
 
 +
{{Out of date|I could not get the method below to work with GDM 3.18.0 - tested on 2015-10-13.}}
 +
 
 +
Alternatively, edit the file {{ic|/var/lib/AccountsService/users/gdm}} and change the language line using the correct UTF-8 value for your language. You should see something similar to the text below:
 +
 
 +
{{hc|1=/var/lib/AccountsService/users/gdm|
 +
2=[User]
 +
Language=fr_FR.UTF-8
 +
XSession=
 +
SystemAccount=true}}
 +
 
 +
Now just reboot your computer.
 +
 
 +
Once you have rebooted, if you look at the {{ic|/var/lib/AccountsService/users/gdm}} file again, you will see that the language line is cleared — do not worry, the language change has been preserved.
 +
 
 +
=== Automatic login ===
  
===Automatic login===
 
 
To enable automatic login with GDM, add the following to {{ic|/etc/gdm/custom.conf}} (replace ''username'' with your own):
 
To enable automatic login with GDM, add the following to {{ic|/etc/gdm/custom.conf}} (replace ''username'' with your own):
  
Line 76: Line 251:
 
AutomaticLoginEnable=True
 
AutomaticLoginEnable=True
 
}}
 
}}
 +
 +
{{Warning|If GDM fails after adding these lines, comment them out from a TTY.}}
  
 
or for an automatic login with a delay:
 
or for an automatic login with a delay:
Line 81: Line 258:
 
{{hc|1=/etc/gdm/custom.conf|
 
{{hc|1=/etc/gdm/custom.conf|
 
2=[daemon]
 
2=[daemon]
# for login with delay
+
 
 
TimedLoginEnable=true
 
TimedLoginEnable=true
 
TimedLogin=''username''
 
TimedLogin=''username''
Line 87: Line 264:
 
}}
 
}}
  
===Passwordless login===
+
=== Passwordless login ===
{{Out of date|Needs to be updated for GDM 3.6|Passwordless login}}
+
 
If you want to bypass the password prompt in GDM then simply add the following line to {{ic|/etc/pam.d/gdm}}:
+
If you want to bypass the password prompt in GDM then simply add the following line on the first line of {{ic|/etc/pam.d/gdm-password}}:
  
 
  auth sufficient pam_succeed_if.so user ingroup nopasswdlogin
 
  auth sufficient pam_succeed_if.so user ingroup nopasswdlogin
  
Make sure this line goes right '''before''' the {{ic|pam_unix.so}} {{ic|auth}} line.
+
Then, add the group {{ic|nopasswdlogin}} to your system. See [[Groups]] for group descriptions and group management commands.
  
Then, add the group {{ic|nopasswdlogin}} to your system. You can do it graphically in {{ic|System > Administration > Users and Groups}}. See [[Groups]] for group descriptions and group management commands.
+
Now, add your user to the {{ic|nopasswdlogin}} group and you will only have to click on your username to login.
  
Now, when you use {{ic|System Settings -> System -> Users Accounts}} (command: {{ic|gnome-control-center}}) and set your user for {{ic|"Password: not asked at login"}} (by checking the {{ic|"Don't ask for password on login"}} option), your user will be automatically added to the {{ic|nopasswdlogin}} group and you will only have to click on your username to login.
+
{{Warning|
  
{{Warning|Do '''not''' do this for a '''root''' account.}}
+
* Do '''not''' do this for a '''root''' account.
 +
* You won't be able to change your session type at login with GDM anymore. If you want to change your default session type, you will first need to remove your user from the {{ic|nopasswdlogin}} group.}}
  
===Passwordless shutdown===
+
=== Passwordless shutdown for multiple sessions ===
GDM is using polkit and logind to gain permissions for shutdown. You can allow it without entering a password first by setting:
+
 
 +
GDM uses polkit and logind to gain permissions for shutdown. You can shutdown the system when multiple users are logged in by setting:
  
 
{{hc|1=/etc/polkit-1/localauthority.conf.d/org.freedesktop.logind.policy|
 
{{hc|1=/etc/polkit-1/localauthority.conf.d/org.freedesktop.logind.policy|
Line 110: Line 289:
 
  "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
 
  "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">
  
<!--
+
<!--  
 
Policy definitions for logind
 
Policy definitions for logind
-->
+
-->
  
 
<policyconfig>
 
<policyconfig>
Line 129: Line 308:
 
You can find all available logind options (e.g. reboot-multiple-sessions) [http://www.freedesktop.org/wiki/Software/systemd/logind#Security here].
 
You can find all available logind options (e.g. reboot-multiple-sessions) [http://www.freedesktop.org/wiki/Software/systemd/logind#Security here].
  
===Changing default GDM session===
+
=== Add or edit GDM sessions ===
If you want to change the default GDM session, you need to create (or edit) the file {{ic|~/.dmrc}} [http://library.gnome.org/admin/gdm/stable/configuration.html.en#userconfig].
+
{{Note|This is on a per-user basis. If you want to change the default for more than one user, you will have to create this file for each user.}}
+
Here is an example to set the default session to [[Cinnamon]]:
+
{{hc|~/.dmrc|<nowiki>
+
[Desktop]
+
Session=cinnamon
+
</nowiki>}}
+
  
===GDM legacy===
+
Each session is a {{ic|.desktop}} file located at {{ic|/usr/share/xsessions/}}.
If you want to fall back to the old GDM, which also has a tool for configuring its settings, compile and install {{aur|gdm-old}} from the [[Arch User Repository|AUR]].
+
  
==Troubleshooting==
+
'''To add a new session:'''
===GDM fails on logout===
+
If GDM starts up properly on boot, but fails after repeated attempts on logout, try adding this line to the daemon section of {{ic|/etc/gdm/custom.conf}}:
+
GdmXserverTimeout=60
+
  
===gconf-sanity-check-2 exited with status 256===
+
1. Copy an existing {{ic|.desktop}} file to use as a template for a new session:
If GDM pops up an error about {{ic|gconf-sanity-check-2}}, you may check permissions in {{ic|/home}} and {{ic|/etc/gconf/gconf.xml.system}} (the latter should be {{ic|755}}).
+
$ cd /usr/share/xsessions
If GDM is still printing the message, try to empty the gdm home. Run as root:
+
# cp gnome.desktop other.desktop
  rm -rf /var/lib/gdm/.*
+
2. Modify the template {{ic|.desktop}} file to open the required window manager:
 +
  # nano other.desktop
  
If that doesn't help, try to set {{ic|/tmp}} owner and permissions to:
+
If you happen to have KDM installed in parallel, you can alternatively open the new session in KDM which will create the new {{ic|.desktop}} file. Then return to using GDM and the new session will be available.
# chown -R root:root /tmp
+
 
# chmod 777 /tmp
+
See also [[Display manager#Session list]].
 +
 
 +
=== Enable root login in GDM ===
  
===GDM root login===
 
 
It is not advised to login as root, but if necessary you can edit {{ic|/etc/pam.d/gdm-password}} and add the following line before the line {{ic|auth required pam_deny.so}}:
 
It is not advised to login as root, but if necessary you can edit {{ic|/etc/pam.d/gdm-password}} and add the following line before the line {{ic|auth required pam_deny.so}}:
 +
 
{{ic|/etc/pam.d/gdm-password}}
 
{{ic|/etc/pam.d/gdm-password}}
 +
 
  auth            sufficient      pam_succeed_if.so uid eq 0 quiet
 
  auth            sufficient      pam_succeed_if.so uid eq 0 quiet
  
 
The file should look something like this:
 
The file should look something like this:
 +
 
{{ic|/etc/pam.d/gdm-password}}
 
{{ic|/etc/pam.d/gdm-password}}
 +
 
  ...
 
  ...
 
  auth            sufficient      pam_succeed_if.so uid eq 0 quiet
 
  auth            sufficient      pam_succeed_if.so uid eq 0 quiet
Line 170: Line 344:
 
You should be able to login as root after restarting GDM.
 
You should be able to login as root after restarting GDM.
  
===GDM always uses default US-keyboard===
+
=== Hide user from login list ===
Problem: Keyboard layout always switches to us; layout is reset when a new keyboard is plugged in.
+
  
====GDM 2.x====
+
The users for the gdm user list are gathered by accountsservice. It will automatically hide system users (UID < 1000).
Solution:
+
To hide ordinary users from the login list create or edit a file named after the user to hide in {{ic|/var/lib/AccountsService/users/}} to contain at least:
edit {{ic|~/.dmrc}}
+
{{hc|/var/lib/AccountsService/users/<nowiki><username></nowiki>|
{{hc|~/.dmrc|2=
+
[User]
[Desktop]
+
<nowiki>SystemAccount=true</nowiki>}}
Language=de_DE.UTF-8  # change to your default lang
+
Layout=de  nodeadkeys # change to your keyboard layout
+
}}
+
  
====GDM 3.x====
+
=== Rotate login screen ===
Solution:
+
add the following line to {{ic|/etc/X11/xorg.conf.d/10-evdev.conf}}, replacing fr with the appropriate keymap
+
{{hc|/etc/X11/xorg.conf.d/10-evdev.conf|
+
Section "InputClass"
+
        Identifier "evdev keyboard catchall"
+
        MatchIsKeyboard "on"
+
        MatchDevicePath "/dev/input/event*"
+
        Driver "evdev"
+
        '''Option "XkbLayout" "fr"'''
+
EndSection}}
+
  
{{Warning|Add the line to the {{ic|'''keyboard''' InputClass}} section, not the pointer one.}}
+
If you have your monitors setup as you like (orientation, primary and so on) in {{ic|~/.config/monitors.xml}} and want GDM to honor those settings:
  
====GDM Will Not Load After Attempting to Set-Up Automatic Login====
+
# cp ~/.config/monitors.xml /var/lib/gdm/.config/monitors.xml
  
To solve this issue, edit {{ic|/etc/gdm/custom.conf}} from a TTY and comment "AutomaticLoginEnable" and the "AutomaticLogin" lines.
+
Changes will take effect on logout.  This is necessary because GDM does not respect {{ic|xorg.conf}}.
  
{{bc|1=# GDM configuration storage
+
{{Note|Wayland backend may be [https://bbs.archlinux.org/viewtopic.php?id&#61;196219 ignoring] {{ic|/var/lib/gdm/.config/monitors.xml}} file. See [[#Use Xorg backend]] to learn how to disable Wayland backend.}}
  
[daemon]
+
=== xrandr at login ===
 +
 
 +
If you want to run a script using xrandr that affects the login screen you must add a script in {{ic|/etc/X11/xinit/xinitrc.d}}.
 +
 
 +
For example, to select automatically a external screen connected through HDMI:
 +
 
 +
{{bc|<nowiki>
 +
#!/bin/sh
 +
EXTERNAL_OUTPUT="HDMI1"
 +
INTERNAL_OUTPUT="eDP1"
 +
if (xrandr | grep $EXTERNAL_OUTPUT | grep " connected "); then
 +
    xrandr --output $INTERNAL_OUTPUT --off --output $EXTERNAL_OUTPUT --auto
 +
else
 +
    xrandr --output $INTERNAL_OUTPUT --auto
 +
fi
 +
</nowiki>}}
 +
 
 +
=== Configure X server access permission ===
 +
 
 +
You can use the {{ic|xhost}} command to configure X server access permissions.
 +
 
 +
For instance, to grant GDM the right to access the X server, use the following command:
 +
 
 +
{{bc|# xhost +SI:localuser:gdm}}
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== Failure to start with AMD Catalyst driver ===
 +
Downgrade the {{pkg|xorg-server}} package or try to use another [[display manager]] like [[LightDM]].
 +
 
 +
=== Failure on logout ===
 +
 
 +
If GDM starts up properly on boot, but fails after repeated attempts on logout, try adding this line to the daemon section of {{ic|/etc/gdm/custom.conf}}:
 +
 
 +
GdmXserverTimeout=60
 +
 
 +
=== Xorg 1.16 ===
 +
 
 +
See [[Xorg#Rootless Xorg (v1.16)]].
 +
 
 +
=== Use Xorg backend ===
 +
 
 +
The [[Wayland]] backend is used by default and the [[Xorg]] backend is used only if the Wayland backend cannot be started. As the Wayland backend has been [https://bugzilla.redhat.com/show_bug.cgi?id=1199890 reported] to cause problems for some users, use of the Xorg backend may be necessary. To use the Xorg backend by default, edit the {{ic|/etc/gdm/custom.conf}} file and uncomment the following line:
 +
#WaylandEnable=false
 +
 
 +
=== Incomplete removal of gdm ===
  
#AutomaticLoginEnable=True
+
After removing gdm (say it was a build dependancy), systemd may report the following:
#AutomaticLogin=user
+
  
[security]
+
user 'gdm': directory '/var/lib/gdm' does not exist
  
[xdmcp]
+
To remove this warning, login as root and delete the primary user "gdm" and then delete the group "gdm":
  
[greeter]
+
#userdel gdm
 +
#groupdel gdm
  
[chooser]
+
Verify that gdm is successfully removed via {{ic|pwck}} and {{ic|grpck}}. To round it off, you may want to double-check no [[Pacman/Tips_and_tricks#Identify_files_not_owned_by_any_package|unowned files]] for gdm remain.
  
[debug]
+
== See also ==
  
EndSection}}
+
* [https://help.gnome.org/admin/gdm/stable/index.html.en GDM Reference Manual]

Latest revision as of 12:34, 3 May 2016

From GDM - GNOME Display Manager: "The GNOME Display Manager (GDM) is a program that manages graphical display servers and handles graphical user logins."

Display managers provide X Window System and Wayland users with a graphical login prompt.

Installation

GDM can be installed with the gdm package, and it is installed as part of the gnome group. To start GDM at boot time enable gdm.service.

If you would prefer to use legacy GDM which was used in GNOME 2 and has its own configuration utility, install the gdm-oldAUR package. Note that the rest of this article discusses current GDM, not legacy GDM, unless indicated otherwise.

You might also wish to install the following:

  • gdm3setup — An interface to configure GDM3, autologin options and change Shell theme
https://github.com/Nano77/gdm3setup || gdm3setupAUR

Configuration

Autostarting applications with GDM

See Display manager#Autostarting. Note that adding scripts to /etc/gdm/Init no longer works, see the upstream bug report.

Log-in screen background image

Note: Since GNOME 3.16, GNOME Shell themes are now stored binary files (gresource).

Firstly, you need to extract the existing GNOME Shell theme to a folder in your home directory. You can do this using the following script:

extractgst.sh
#!/bin/sh

workdir=${HOME}/shell-theme
if [ ! -d ${workdir}/theme ]; then
  mkdir -p ${workdir}/theme
fi
gst=/usr/share/gnome-shell/gnome-shell-theme.gresource

for r in `gresource list $gst`; do
        gresource extract $gst $r >$workdir${r/#\/org\/gnome\/shell/}
done

Navigate to the created directory. You should find that the theme files have been extracted to it. Now copy your preferred background image to this directory.

Next, you need to create a file in the directory with the following content:

gnome-shell-theme.gresource.xml
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
  <gresource prefix="/org/gnome/shell/theme">
    <file>calendar-arrow-left.svg</file>
    <file>calendar-arrow-right.svg</file>
    <file>calendar-today.svg</file>
    <file>checkbox-focused.svg</file>
    <file>checkbox-off-focused.svg</file>
    <file>checkbox-off.svg</file>
    <file>checkbox.svg</file>
    <file>close-window.svg</file>
    <file>close.svg</file>
    <file>corner-ripple-ltr.png</file>
    <file>corner-ripple-rtl.png</file>
    <file>dash-placeholder.svg</file>
    <file>filter-selected-ltr.svg</file>
    <file>filter-selected-rtl.svg</file>
    <file>gnome-shell.css</file>
    <file>gnome-shell-high-contrast.css</file>
    <file>logged-in-indicator.svg</file>
    <file>filename</file>
    <file>more-results.svg</file>
    <file>no-events.svg</file>
    <file>no-notifications.svg</file>
    <file>noise-texture.png</file>
    <file>page-indicator-active.svg</file>
    <file>page-indicator-inactive.svg</file>
    <file>page-indicator-checked.svg</file>
    <file>page-indicator-hover.svg</file>
    <file>process-working.svg</file>
    <file>running-indicator.svg</file>
    <file>source-button-border.svg</file>
    <file>summary-counter.svg</file>
    <file>toggle-off-us.svg</file>
    <file>toggle-off-intl.svg</file>
    <file>toggle-on-hc.svg</file>
    <file>toggle-on-us.svg</file>
    <file>toggle-on-intl.svg</file>
    <file>ws-switch-arrow-up.png</file>
    <file>ws-switch-arrow-down.png</file>
  </gresource>
</gresources>

Replace filename with the filename of your background image.

Now, open the gnome-shell.css file in the directory and change the #lockDialogGroup definition as follows:

#lockDialogGroup {
  background: #2e3436 url(filename);
  background-size: [WIDTH]px [HEIGHT]px;
  background-repeat: no-repeat;
}

Set background-size to the resolution that GDM uses, this might not necessarily be the resolution of the image. For a list of display resolutions see Display resolution. Again, set filename to be the name of the background image.

Finally, compile the theme using the following command:

$ glib-compile-resources gnome-shell-theme.gresource.xml

Then copy the resulting gnome-shell-theme.gresource file to the /usr/share/gnome-shell directory.

Restart GDM - you should find that it is using your preferred background image.

For more information, please see the following forum thread.

DConf configuration

Some GDM settings are stored in a DConf database. They can be configured either by adding keyfiles to the /etc/dconf/db/gdm.d directory and then recompiling the GDM database by running dconf update as root or by logging into the GDM user on the system and changing the setting directly using the gsettings command line tool. Note that for the former approach, a GDM profile file is required - this must be created manually as it is no longer shipped upstream, see below:

/etc/dconf/profile/gdm
user-db:user
system-db:gdm
file-db:/usr/share/gdm/greeter-dconf-defaults

For the latter approach, you can log into the GDM user with the command below:

# machinectl shell gdm@

Either create the following keyfile

/etc/dconf/db/gdm.d/02-logo
[org/gnome/login-screen]
logo='/path/to/logo.png'

and then recompile the GDM database or alternatively log in to the GDM user and execute the following:

$ gsettings set org.gnome.login-screen logo '/path/to/logo.png'

Changing the cursor theme

GDM disregards GNOME cursor theme settings and it also ignores the cursor theme set according to the XDG specification. To change the cursor theme used in GDM, either create the following keyfile

/etc/dconf/db/gdm.d/10-cursor-settings
[org/gnome/desktop/interface]
cursor-theme='theme-name'

and then recompile the GDM database or alternatively log in to the GDM user and execute the following:

$ gsettings set org.gnome.desktop.interface cursor-theme 'theme-name'

Larger font for log-in screen

Click on the accessibility icon at the top right of the screen (a white circle with the silhouette of a person in the centre) and check the Large Text option.

To set a specific scaling factor, you can create the following keyfile:

/etc/dconf/db/gdm.d/03-scaling
[org/gnome/desktop/interface]
text-scaling-factor='1.25'

and then recompile the GDM database or alternatively log in to the GDM user and execute the following:

$ gsettings set org.gnome.desktop.interface text-scaling-factor '1.25'

Turning off the sound

This tweak disables the audible feedback heard when the system volume is adjusted (via keyboard) on the login screen.

Either create the following keyfile:

/etc/dconf/db/gdm.d/04-sound
[org/gnome/desktop/sound]
event-sounds='false'

and then recompile the GDM database or alternatively log in to the GDM user and execute the following:

$ gsettings set org.gnome.desktop.sound event-sounds 'false'

Make the power button interactive

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: Some button-* configuration options are no longer available from GDM 3.18. (Discuss in Talk:GDM#"Make the power button interactive" no longer possible with GDM 3.18)

The behaviour of the power buttons can be configured in GDM. The example below will configure the power and hibernate buttons to Show dialog:

Create the following keyfile:

/etc/dconf/db/gdm.d/05-power
[org/gnome/settings-daemon/plugins/power button]
power='interactive'
hibernate='interactive'

and then recompile the GDM database.

Warning: Please note that the acpid daemon also handles the "power button" and "hibernate button" events. Running both systems at the same time may lead to unexpected behaviour.

Enabling tap-to-click

Tap-to-click is disabled in GDM (and GNOME) by default, but you can easily enable it with a dconf setting.

Note: If you want to do this under X, you have to first set up correct X server access permissions - see #Configure X server access permission.

To directly enable tap-to-click, use:

# sudo -u gdm gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true

If you prefer to do this with a GUI, use:

# sudo -u gdm dconf-editor

To check the if it was set correctly, use:

$ sudo -u gdm gsettings get org.gnome.desktop.peripherals.touchpad tap-to-click

GDM keyboard layout

See Keyboard configuration in Xorg#Using X configuration files.

Tip: See Wikipedia:ISO 3166-1 for a list of keymaps.

GNOME Control Center

If the package gnome-control-center is installed, the keyboard layout(s) can be configured using a graphical frontend. Start gnome-control-center and navigate to Keyboard -> Input Sources. Then, in the header bar, hit the Login Screen toggle button to configure the keyboard layout for GDM specifically.

GDM 2.x layout

Users of legacy GDM may need to follow the instructions below:

Edit ~/.dmrc:

~/.dmrc
[Desktop]
Language=de_DE.UTF-8   # change to your default lang
Layout=de   nodeadkeys # change to your keyboard layout

Change the language

To change the GDM language, ensure that gnome-control-center is installed. Then, start gnome-control-center and choose Region & Language. In the header bar, check the Login Screen toggle button. Finally, click on Language and choose your language from the list. You will be prompted for your root password.

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: I could not get the method below to work with GDM 3.18.0 - tested on 2015-10-13. (Discuss in Talk:GDM#)

Alternatively, edit the file /var/lib/AccountsService/users/gdm and change the language line using the correct UTF-8 value for your language. You should see something similar to the text below:

/var/lib/AccountsService/users/gdm
[User]
Language=fr_FR.UTF-8
XSession=
SystemAccount=true

Now just reboot your computer.

Once you have rebooted, if you look at the /var/lib/AccountsService/users/gdm file again, you will see that the language line is cleared — do not worry, the language change has been preserved.

Automatic login

To enable automatic login with GDM, add the following to /etc/gdm/custom.conf (replace username with your own):

/etc/gdm/custom.conf
# Enable automatic login for user
[daemon]
AutomaticLogin=username
AutomaticLoginEnable=True
Warning: If GDM fails after adding these lines, comment them out from a TTY.

or for an automatic login with a delay:

/etc/gdm/custom.conf
[daemon]

TimedLoginEnable=true
TimedLogin=username
TimedLoginDelay=1

Passwordless login

If you want to bypass the password prompt in GDM then simply add the following line on the first line of /etc/pam.d/gdm-password:

auth sufficient pam_succeed_if.so user ingroup nopasswdlogin

Then, add the group nopasswdlogin to your system. See Groups for group descriptions and group management commands.

Now, add your user to the nopasswdlogin group and you will only have to click on your username to login.

Warning:
  • Do not do this for a root account.
  • You won't be able to change your session type at login with GDM anymore. If you want to change your default session type, you will first need to remove your user from the nopasswdlogin group.

Passwordless shutdown for multiple sessions

GDM uses polkit and logind to gain permissions for shutdown. You can shutdown the system when multiple users are logged in by setting:

/etc/polkit-1/localauthority.conf.d/org.freedesktop.logind.policy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">


<policyconfig>

  <action id="org.freedesktop.login1.power-off-multiple-sessions">
    <description>Shutdown the system when multiple users are logged in</description>
    <message>System policy prevents shutting down the system when other users are logged in</message>
    <defaults>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
  </action>

</policyconfig>

You can find all available logind options (e.g. reboot-multiple-sessions) here.

Add or edit GDM sessions

Each session is a .desktop file located at /usr/share/xsessions/.

To add a new session:

1. Copy an existing .desktop file to use as a template for a new session:

$ cd /usr/share/xsessions
# cp gnome.desktop other.desktop

2. Modify the template .desktop file to open the required window manager:

# nano other.desktop

If you happen to have KDM installed in parallel, you can alternatively open the new session in KDM which will create the new .desktop file. Then return to using GDM and the new session will be available.

See also Display manager#Session list.

Enable root login in GDM

It is not advised to login as root, but if necessary you can edit /etc/pam.d/gdm-password and add the following line before the line auth required pam_deny.so:

/etc/pam.d/gdm-password

auth            sufficient      pam_succeed_if.so uid eq 0 quiet

The file should look something like this:

/etc/pam.d/gdm-password

...
auth            sufficient      pam_succeed_if.so uid eq 0 quiet
auth            sufficient      pam_succeed_if.so uid >= 1000 quiet
auth            required        pam_deny.so
...

You should be able to login as root after restarting GDM.

Hide user from login list

The users for the gdm user list are gathered by accountsservice. It will automatically hide system users (UID < 1000). To hide ordinary users from the login list create or edit a file named after the user to hide in /var/lib/AccountsService/users/ to contain at least:

/var/lib/AccountsService/users/<username>
[User]
SystemAccount=true

Rotate login screen

If you have your monitors setup as you like (orientation, primary and so on) in ~/.config/monitors.xml and want GDM to honor those settings:

# cp ~/.config/monitors.xml /var/lib/gdm/.config/monitors.xml

Changes will take effect on logout. This is necessary because GDM does not respect xorg.conf.

Note: Wayland backend may be ignoring /var/lib/gdm/.config/monitors.xml file. See #Use Xorg backend to learn how to disable Wayland backend.

xrandr at login

If you want to run a script using xrandr that affects the login screen you must add a script in /etc/X11/xinit/xinitrc.d.

For example, to select automatically a external screen connected through HDMI:

#!/bin/sh
EXTERNAL_OUTPUT="HDMI1"
INTERNAL_OUTPUT="eDP1"
if (xrandr | grep $EXTERNAL_OUTPUT | grep " connected "); then
    xrandr --output $INTERNAL_OUTPUT --off --output $EXTERNAL_OUTPUT --auto
else
    xrandr --output $INTERNAL_OUTPUT --auto
fi

Configure X server access permission

You can use the xhost command to configure X server access permissions.

For instance, to grant GDM the right to access the X server, use the following command:

# xhost +SI:localuser:gdm

Troubleshooting

Failure to start with AMD Catalyst driver

Downgrade the xorg-server package or try to use another display manager like LightDM.

Failure on logout

If GDM starts up properly on boot, but fails after repeated attempts on logout, try adding this line to the daemon section of /etc/gdm/custom.conf:

GdmXserverTimeout=60

Xorg 1.16

See Xorg#Rootless Xorg (v1.16).

Use Xorg backend

The Wayland backend is used by default and the Xorg backend is used only if the Wayland backend cannot be started. As the Wayland backend has been reported to cause problems for some users, use of the Xorg backend may be necessary. To use the Xorg backend by default, edit the /etc/gdm/custom.conf file and uncomment the following line:

#WaylandEnable=false

Incomplete removal of gdm

After removing gdm (say it was a build dependancy), systemd may report the following:

user 'gdm': directory '/var/lib/gdm' does not exist

To remove this warning, login as root and delete the primary user "gdm" and then delete the group "gdm":

#userdel gdm
#groupdel gdm

Verify that gdm is successfully removed via pwck and grpck. To round it off, you may want to double-check no unowned files for gdm remain.

See also