Difference between revisions of "GDM"

From ArchWiki
Jump to: navigation, search
(Changing default GDM session)
(original content was copied over from the login screen section on the gnome page due to merge request. this edit replaces that content with the content on the gdm discussion page as it is of better quality. please undo if you disagree.)
Line 40: Line 40:
  
 
==Configuration==
 
==Configuration==
===Configuration using gesttings/dconf===
+
=== Login background image ===
Once session variables have been exported, you may issue commands to retrieve or set items used by GDM.
+
==== Login background image ====
+
The easiest way to change the settings is by launching the Configuration Editor gui with the command
+
  
$ dconf-editor
+
To change the wallpaper of the login screen use
  
The location of each setting in dconf is the same as the syntax of gsettings e.g. ''org.gnome.desktop'' like the commands shown below:
+
# mkdir /opt/login
 +
# echo -e "[org/gnome/desktop/background]\npicture-uri='file:///opt/login/wallpaper.jpg'" > /etc/dconf/db/gdm.d/01-background
 +
# cp [YOUR FILE] /opt/login/wallpaper.jpg
 +
# dconf update
  
The following is the command-line approach to retrieve or set the file name used for GDM's wallpaper.
+
where [YOUR FILE] needs to be a *.jpg picture.
{{bc|<nowiki>
+
$  GSETTINGS_BACKEND=dconf gsettings get org.gnome.desktop.background picture-uri
+
$  GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background picture-uri 'file:///usr/share/backgrounds/gnome/SundownDunes.jpg'
+
+
$  GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.background picture-options 'zoom'
+
## Possible values: centered, none, scaled, spanned, stretched, wallpaper, zoom</nowiki>}}
+
{{Note|You must specify a file which user "gdm" has permission to read. GDM cannot read files in your home directory.}}
+
  
==== Larger font for login ====
+
==== Logo on login screen ====
  
This tweak enlarges the login font with a scaling factor. It is the same method employed by ''Accessibility Manager'' on the desktop.
+
To display a logo on your login screen use
+
$ GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.interface text-scaling-factor '1.25'
+
  
==== Turning off the sound ====
+
# mkdir /opt/login
 +
# echo -e "[org/gnome/login-screen]\nlogo='/opt/login/logo.png'" > /etc/dconf/db/gdm.d/02-logo
 +
# cp [YOUR FILE] /opt/login/logo.png
 +
# dconf update
  
This tweak disables the audible feedback heard when the system volume is adjusted (via keyboard) on the login screen.
+
where [YOUR FILE] needs to be a *.png picture.
  
$ GSETTINGS_BACKEND=dconf gsettings set org.gnome.desktop.sound event-sounds 'false'
+
=== Larger font for login ===
  
If the above tweak does not work for you or you are unable to export the GDM session variables, try muting the volume in the GDM login screen using your multimedia keys.
+
To change the font size of the login screen use
  
==== Make the power button interactive ====
+
# echo -e "[org/gnome/desktop/interface]\ntext-scaling-factor='1.25'" > /etc/dconf/db/gdm.d/03-scaling
 +
# 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.
 +
 
 +
# echo -e "[org/gnome/desktop/sound]\nevent-sounds='false'" > /etc/dconf/db/gdm.d/04-sound
 +
# 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.
 
The default installation sets the power button to suspend the system. '''''Power off'''''  or  '''''Show dialog'''''  is a better choice.
  $ GSETTINGS_BACKEND=dconf gsettings set org.gnome.settings-daemon.plugins.power button-power 'interactive'
 
  $ GSETTINGS_BACKEND=dconf gsettings set org.gnome.settings-daemon.plugins.power button-hibernate 'interactive'
 
  $ gsettings list-recursively org.gnome.settings-daemon.plugins.power
 
  
{{Warning|Please note that the [[Acpid|acpid]] daemon also handles the "power button" an "hibernate button" event. Running both systems at the same time may lead to unexpected behaviour.}}
+
# echo -e "[org/gnome/settings-daemon/plugins/power button]\npower='interactive'\nhibernate='interactive'" > /etc/dconf/db/gdm.d/05-power
 +
# dconf update
 +
 
 +
{{Warning|Please note that the [[Acpid|acpid]] daemon also handle the "power button" an "hibernate button" event. Running both systems at the same time may lead to unexpected behaviour.}}
 +
 
 +
=== Prevent suspend when closing the lid ===
 +
 
 +
On some systems it happens that your laptop suspends when you are closing the lid 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, append the following line to {{ic|/etc/systemd/logind.conf}}:
 +
 
 +
HandleLidSwitch=ignore
  
==== GDM keyboard layout ====
+
=== GDM keyboard layout ===
  
To change keyboard settings used by GDM, set your layout using Xorg configuration. Refer to this section of the [[Beginners'_Guide#Non-US_keyboard|Beginner's Guide.]]
+
GDM does not know about your GNOME 3 desktop keyboard settings. To change keyboard settings used by GDM, set your layout using Xorg configuration. Refer to this section of the [[Beginners'_Guide#Non-US_keyboard|Beginner's Guide.]]
  
===Other configuration===
+
===Change the language===
The instructions here do not require the use of gsettings/dconf.
+
====Change the language====
+
 
To change the GDM language, 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:
 
To change the GDM language, 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|
 
{{hc|1=/var/lib/AccountsService/users/gdm|
Line 99: Line 107:
 
Once you've rebooted, if you look at the {{ic|/var/lib/AccountsService/users/gdm}} file again, you'll see that the language line is cleared - don't worry, the language change has been preserved.
 
Once you've rebooted, if you look at the {{ic|/var/lib/AccountsService/users/gdm}} file again, you'll see that the language line is cleared - don't 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 119: Line 127:
 
}}
 
}}
  
====Passwordless login====
+
===Passwordless login===
 
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}}:
 
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}}:
  
Line 131: Line 139:
 
{{Warning|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.}}
 
{{Warning|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===
 
GDM is using polkit and logind to gain permissions for shutdown. You can allow it without entering a password first by setting:
 
GDM is using polkit and logind to gain permissions for shutdown. You can allow it without entering a password first by setting:
  
Line 159: Line 167:
 
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====
+
===Changing default GDM session===
 
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].
 
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.}}
 
{{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.}}
Line 168: Line 176:
 
</nowiki>}}
 
</nowiki>}}
  
====Enable root login in GDM====
+
===Enable root login in GDM===
 
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}}
Line 183: Line 191:
 
You should be able to login as root after restarting GDM.
 
You should be able to login as root after restarting GDM.
  
====Configuration for older versions of GDM 3====
+
===Configuration for older versions of GDM 3===
  
 
{{Out of date|Needs to be updated for GDM 3.6 as gconf vars are being moved to dconf, control center incomplete by default|GNOME#Hidden_features}}
 
{{Out of date|Needs to be updated for GDM 3.6 as gconf vars are being moved to dconf, control center incomplete by default|GNOME#Hidden_features}}
Line 216: Line 224:
 
You can install the {{aur|gdm3setup}} tool from the AUR to configure GDM. It will allow you to change few settings such as the theme, the automatic connexion or the date format.
 
You can install the {{aur|gdm3setup}} tool from the AUR to configure GDM. It will allow you to change few settings such as the theme, the automatic connexion or the date format.
  
==GDM legacy==
+
===GDM legacy===
 
If you want to fall back to the old GDM, which also has a tool for configuring its settings, install {{aur|gdm-old}} from the [[Arch User Repository|AUR]].
 
If you want to fall back to the old GDM, which also has a tool for configuring its settings, install {{aur|gdm-old}} from the [[Arch User Repository|AUR]].
  

Revision as of 21:12, 14 January 2014

From GDM - GNOME Display Manager:

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

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. If you installed the gnome group then GDM will already be installed.

To make GDM the default display manager for the system enable 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

Login background image

To change the wallpaper of the login screen use

# mkdir /opt/login
# echo -e "[org/gnome/desktop/background]\npicture-uri='file:///opt/login/wallpaper.jpg'" > /etc/dconf/db/gdm.d/01-background
# cp [YOUR FILE] /opt/login/wallpaper.jpg
# dconf update

where [YOUR FILE] needs to be a *.jpg picture.

Logo on login screen

To display a logo on your login screen use

# mkdir /opt/login
# echo -e "[org/gnome/login-screen]\nlogo='/opt/login/logo.png'" > /etc/dconf/db/gdm.d/02-logo
# cp [YOUR FILE] /opt/login/logo.png
# dconf update

where [YOUR FILE] needs to be a *.png picture.

Larger font for login

To change the font size of the login screen use

# echo -e "[org/gnome/desktop/interface]\ntext-scaling-factor='1.25'" > /etc/dconf/db/gdm.d/03-scaling
# 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.

# echo -e "[org/gnome/desktop/sound]\nevent-sounds='false'" > /etc/dconf/db/gdm.d/04-sound
# 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.

# echo -e "[org/gnome/settings-daemon/plugins/power button]\npower='interactive'\nhibernate='interactive'" > /etc/dconf/db/gdm.d/05-power
# dconf update
Warning: Please note that the acpid daemon also handle the "power button" an "hibernate button" event. Running both systems at the same time may lead to unexpected behaviour.

Prevent suspend when closing the lid

On some systems it happens that your laptop suspends when you are closing the lid 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, append the following line to /etc/systemd/logind.conf:

HandleLidSwitch=ignore

GDM keyboard layout

GDM does not know about your GNOME 3 desktop keyboard settings. To change keyboard settings used by GDM, set your layout using Xorg configuration. Refer to this section of the Beginner's Guide.

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've rebooted, if you look at the /var/lib/AccountsService/users/gdm file again, you'll see that the language line is cleared - don't 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

or for an automatic login with a delay:

/etc/gdm/custom.conf
[daemon]
# for login with delay
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.
Warning: 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

GDM is using polkit and logind to gain permissions for shutdown. You can allow it without entering a password first 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.

Changing default GDM session

If you want to change the default GDM session, you need to create (or edit) the file ~/.dmrc [1].

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:

~/.dmrc
[Desktop]
Session=cinnamon

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.

Configuration for older versions of GDM 3

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

Reason: Needs to be updated for GDM 3.6 as gconf vars are being moved to dconf, control center incomplete by default (Discuss in GNOME#Hidden_features)

You can use the following instructions.

Configure X server access permission:

# xhost +SI:localuser:gdm

Change the theme:

$ sudo -u gdm dbus-launch gnome-control-center

For more configuration options, do:

$ sudo -u gdm dbus-launch gconf-editor

and modify the following hierarchies:

/apps/gdm/simple-greeter
/desktop/gnome/interface
/desktop/gnome/background

If these commands fail with an error (e.g. "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:

# 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:

# rm /usr/share/gdm/autostart/LoginWindow/gnome-appearance-properties.desktop /usr/share/gdm/autostart/LoginWindow/gconf-editor.desktop
Note: By using the logout/configure method you can view the changes while you're making them.

For more information and advanced settings read this.

gdm3setup

You can install the gdm3setupAUR tool from the AUR to configure GDM. It will allow you to change few settings such as the theme, the automatic connexion 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.

Troubleshooting

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 /etc/gdm/custom.conf:

GdmXserverTimeout=60

gconf-sanity-check-2 exited with status 256

If GDM pops up an error about gconf-sanity-check-2, you may check permissions in /home and /etc/gconf/gconf.xml.system (the latter should be 755). If GDM is still printing the message, try to empty the gdm home. Run as root:

rm -rf /var/lib/gdm/.*

If that doesn't help, try to set /tmp owner and permissions to:

# chown -R root:root /tmp
# chmod 777 /tmp

GDM always uses default US-keyboard

Problem: Keyboard layout always switches to us; layout is reset when a new keyboard is plugged in.

GDM 2.x

Solution: edit ~/.dmrc

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

GDM 3.x

Solution: add the following line to /etc/X11/xorg.conf.d/10-evdev.conf, replacing fr with the appropriate keymap

/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 keyboard InputClass section, not any of the other sections.

GDM will not load after attempting to set up automatic login

To solve this issue, edit /etc/gdm/custom.conf from a TTY and comment "AutomaticLoginEnable" and the "AutomaticLogin" lines.

# GDM configuration storage

[daemon]

#AutomaticLoginEnable=True
#AutomaticLogin=user

[security]

[xdmcp]

[greeter]

[chooser]

[debug]

GDM does not start after upgrading to 3.8 if using Intel graphics

To solve this problem, you may have to set your acceleration method to SNA. For more information, please refer to: Intel_Graphics#Choose_acceleration_method