Difference between revisions of "GDM"

From ArchWiki
Jump to: navigation, search
(Log-in screen background image)
m (Fix link: Display Manager redirects to Display manager)
Line 359: Line 359:
  
 
=== Failure to start with AMD Catalyst driver ===
 
=== Failure to start with AMD Catalyst driver ===
Downgrade the {{pkg|xorg-server}} package or try to use another [[Display Manager]] like [[LightDM]].
+
Downgrade the {{pkg|xorg-server}} package or try to use another [[display manager]] like [[LightDM]].
  
 
=== Failure on logout ===
 
=== Failure on logout ===

Revision as of 09:14, 22 April 2015

zh-CN:GDM

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 users with a graphical login prompt.

Installation

GDM can be installed with the gdm package, available in the Official repositories and it is installed as part of the gnome group.

To start GDM at boot time enable its systemd service file as shown below:

# systemctl enable gdm

The arguments passed to the X server by ~/.xinitrc (such as those of xmodmap and xsetroot) can also be added through xprofile:

~/.xprofile
#!/bin/sh

#
# ~/.xprofile
#
# Executed by gdm at login
#

xmodmap -e "pointer =1 2 3 6 7 4 5" # set mouse buttons up correctly
xsetroot -solid black              # sets the background to black

Configuration

Log-in screen background image

Copy your background image of choice into the gnome-shell/theme directory:

 # cp path/to/your/image.png /usr/share/gnome-shell/theme/login-background.png

The file doesn't have to be a PNG image.

Open /usr/share/gnome-shell/theme/gnome-shell.css and change the #lockDialogGroup definition as follows:

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

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

Note:
  • Themes may replace gnome-shell.css or even the whole theme directory.
  • Since GNOME 3.16, themes are now in binary files (gresource) so that gnome-classic.css changes will only affect GNOME Classic session only.

Log-in screen background image (outdated)

To change the wallpaper of the log-in screen, follow the instructions below:

First, create the directory to store the background image:

# mkdir /opt/login

Then, create the necessary configuration file:

# touch /etc/dconf/db/gdm.d/01-background

Now, copy this text into the the file you just created:

[org/gnome/desktop/background]
picture-uri='file:///opt/login/wallpaper.jpg'

Copy your background image of choice into the directory:

# cp [YOUR FILE] /opt/login/wallpaper.jpg

where [YOUR FILE] needs to be a path to a JPEG image.

Finally, update dconf as shown below:

# dconf update

To display a logo on your log-in screen, follow the instructions below.

Create the directory to store the logo:

# mkdir /opt/login

Create the necessary configuration file:

# touch /etc/dconf/db/gdm.d/02-logo

Copy this text into the file:

[org/gnome/login-screen]
logo='/opt/login/logo.png'

Copy your logo of choice into the directory:

# cp [YOUR FILE] /opt/login/logo.png

where [YOUR FILE] needs to be a path to a PNG image.

Update dconf:

# dconf update

Changing the GDM cursor theme

Please see this section of the Cursor Themes article.

Larger font for log-in screen

To change the font size of the log-in screen, follow the instructions below:

Create the necessary configuration file:

# touch /etc/dconf/db/gdm.d/03-scaling

Copy this text into the file:

[org/gnome/desktop/interface]
text-scaling-factor='1.25'

Update dconf:

# dconf update

Turning off the sound

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

Create the necessary configuration file:

# touch /etc/dconf/db/gdm.d/04-sound

Copy this text into the file:

[org/gnome/desktop/sound]
event-sounds='false'

Update dconf:

# dconf update

Make the power button interactive

The default installation sets the power button to suspend the system. Power off or Show dialog is a better choice.

Create the necessary configuration file:

# touch /etc/dconf/db/gdm.d/05-power

Copy this text into the file:

[org/gnome/settings-daemon/plugins/power button]
power='interactive'
hibernate='interactive'

Update dconf:

# dconf update
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.

Prevent suspend when closing the lid

Some laptops may experience behaviour where the laptop suspends when the lid is closed despite having set the options Laptop lid close action on battery and Laptop lid close action on AC to blank. If this is the case uncomment the HandleLidSwitch line in the /etc/systemd/logind.conf file and change the value to ignore. The value is set to suspend by default.

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 grapical frontend:

Settings > Keyboard > Input Sources > Login Screen

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, 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.

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

gdm3setup

You can install the gdm3setupAUR tool from the AUR to configure GDM. It will allow you to change a few settings, such as the theme, the automatic connection, or the date format.

GDM legacy

If you want to fall back to the old GDM, which also has a tool for configuring its settings, install gdm-oldAUR from the AUR.

GDM Initial Setup mode

When gnome-initial-setup is installed, and no user accounts (UID>=1000) available on the system, GDM starts in Initial Setup mode. In this mode the user can prepare a new system: configure system locale, keyboard, network (via NetworkManager), and create the first user account.

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).

See also