Next: , Previous: , Up: Services   [Contents][Index]


8.8.5 X Window

Support for the X Window graphical display system—specifically Xorg—is provided by the (gnu services xorg) module. Note that there is no xorg-service procedure. Instead, the X server is started by the login manager, by default the GNOME Display Manager (GDM).

GDM of course allows users to log in into window managers and desktop environments other than GNOME; for those using GNOME, GDM is required for features such as automatic screen locking.

To use X11, you must install at least one window manager—for example the windowmaker or openbox packages—preferably by adding it to the packages field of your operating system definition (see system-wide packages).

Scheme Variable: gdm-service-type

This is the type for the GNOME Desktop Manager (GDM), a program that manages graphical display servers and handles graphical user logins. Its value must be a gdm-configuration (see below.)

GDM looks for session types described by the .desktop files in /run/current-system/profile/share/xsessions and allows users to choose a session from the log-in screen. Packages such as gnome, xfce, and i3 provide .desktop files; adding them to the system-wide set of packages automatically makes them available at the log-in screen.

In addition, ~/.xsession files are honored. When available, ~/.xsession must be an executable that starts a window manager and/or other X clients.

Data Type: gdm-configuration
auto-login? (default: #f)
default-user (default: #f)

When auto-login? is false, GDM presents a log-in screen.

When auto-login? is true, GDM logs in directly as default-user.

gnome-shell-assets (default: ...)

List of GNOME Shell assets needed by GDM: icon theme, fonts, etc.

xorg-configuration (default: (xorg-configuration))

Configuration of the Xorg graphical server.

xsession (default: (xinitrc))

Script to run before starting a X session.

dbus-daemon (default: dbus-daemon-wrapper)

File name of the dbus-daemon executable.

gdm (default: gdm)

The GDM package to use.

Scheme Variable: slim-service-type

This is the type for the SLiM graphical login manager for X11.

Like GDM, SLiM looks for session types described by .desktop files and allows users to choose a session from the log-in screen using F1. It also honors ~/.xsession files.

Unlike GDM, SLiM does not spawn the user session on a different VT after logging in, which means that you can only start one graphical session. If you want to be able to run multiple graphical sessions at the same time you have to add multiple SLiM services to your system services. The following example shows how to replace the default GDM service with two SLiM services on tty7 and tty8.

(use-modules (gnu services)
             (gnu services desktop)
             (gnu services xorg)
             (srfi srfi-1))  ;for 'remove'

(operating-system
  ;; ...
  (services (cons* (service slim-service-type (slim-configuration
                                               (display ":0")
                                               (vt "vt7")))
                   (service slim-service-type (slim-configuration
                                               (display ":1")
                                               (vt "vt8")))
                   (remove (lambda (service)
                             (eq? (service-kind service) gdm-service-type))
                           %desktop-services))))
Data Type: slim-configuration

Data type representing the configuration of slim-service-type.

allow-empty-passwords? (default: #t)

Whether to allow logins with empty passwords.

auto-login? (default: #f)
default-user (default: "")

When auto-login? is false, SLiM presents a log-in screen.

When auto-login? is true, SLiM logs in directly as default-user.

theme (default: %default-slim-theme)
theme-name (default: %default-slim-theme-name)

The graphical theme to use and its name.

auto-login-session (default: #f)

If true, this must be the name of the executable to start as the default session—e.g., (file-append windowmaker "/bin/windowmaker").

If false, a session described by one of the available .desktop files in /run/current-system/profile and ~/.guix-profile will be used.

Note: You must install at least one window manager in the system profile or in your user profile. Failing to do that, if auto-login-session is false, you will be unable to log in.

xorg-configuration (default (xorg-configuration))

Configuration of the Xorg graphical server.

display (default ":0")

The display on which to start the Xorg graphical server.

vt (default "vt7")

The VT on which to start the Xorg graphical server.

xauth (default: xauth)

The XAuth package to use.

shepherd (default: shepherd)

The Shepherd package used when invoking halt and reboot.

sessreg (default: sessreg)

The sessreg package used in order to register the session.

slim (default: slim)

The SLiM package to use.

Scheme Variable: %default-theme
Scheme Variable: %default-theme-name

The default SLiM theme and its name.

Data Type: sddm-configuration

This is the data type representing the sddm service configuration.

display-server (default: "x11")

Select display server to use for the greeter. Valid values are "x11" or "wayland".

numlock (default: "on")

Valid values are "on", "off" or "none".

halt-command (default #~(string-apppend #$shepherd "/sbin/halt"))

Command to run when halting.

reboot-command (default #~(string-append #$shepherd "/sbin/reboot"))

Command to run when rebooting.

theme (default "maldives")

Theme to use. Default themes provided by SDDM are "elarun" or "maldives".

themes-directory (default "/run/current-system/profile/share/sddm/themes")

Directory to look for themes.

faces-directory (default "/run/current-system/profile/share/sddm/faces")

Directory to look for faces.

default-path (default "/run/current-system/profile/bin")

Default PATH to use.

minimum-uid (default 1000)

Minimum UID to display in SDDM.

maximum-uid (default 2000)

Maximum UID to display in SDDM

remember-last-user? (default #t)

Remember last user.

remember-last-session? (default #t)

Remember last session.

hide-users (default "")

Usernames to hide from SDDM greeter.

hide-shells (default #~(string-append #$shadow "/sbin/nologin"))

Users with shells listed will be hidden from the SDDM greeter.

session-command (default #~(string-append #$sddm "/share/sddm/scripts/wayland-session"))

Script to run before starting a wayland session.

sessions-directory (default "/run/current-system/profile/share/wayland-sessions")

Directory to look for desktop files starting wayland sessions.

xorg-configuration (default (xorg-configuration))

Configuration of the Xorg graphical server.

xauth-path (default #~(string-append #$xauth "/bin/xauth"))

Path to xauth.

xephyr-path (default #~(string-append #$xorg-server "/bin/Xephyr"))

Path to Xephyr.

xdisplay-start (default #~(string-append #$sddm "/share/sddm/scripts/Xsetup"))

Script to run after starting xorg-server.

xdisplay-stop (default #~(string-append #$sddm "/share/sddm/scripts/Xstop"))

Script to run before stopping xorg-server.

xsession-command (default: xinitrc)

Script to run before starting a X session.

xsessions-directory (default: "/run/current-system/profile/share/xsessions")

Directory to look for desktop files starting X sessions.

minimum-vt (default: 7)

Minimum VT to use.

auto-login-user (default "")

User to use for auto-login.

auto-login-session (default "")

Desktop file to use for auto-login.

relogin? (default #f)

Relogin after logout.

Scheme Procedure: sddm-service config

Return a service that spawns the SDDM graphical login manager for config of type <sddm-configuration>.

  (sddm-service (sddm-configuration
                 (auto-login-user "Alice")
                 (auto-login-session "xfce.desktop")))
Data Type: xorg-configuration

This data type represents the configuration of the Xorg graphical display server. Note that there is not Xorg service; instead, the X server is started by a “display manager” such as GDM, SDDM, and SLiM. Thus, the configuration of these display managers aggregates an xorg-configuration record.

modules (default: %default-xorg-modules)

This is a list of module packages loaded by the Xorg server—e.g., xf86-video-vesa, xf86-input-keyboard, and so on.

fonts (default: %default-xorg-fonts)

This is a list of font directories to add to the server’s font path.

drivers (default: '())

This must be either the empty list, in which case Xorg chooses a graphics driver automatically, or a list of driver names that will be tried in this order—e.g., ("modesetting" "vesa").

resolutions (default: '())

When resolutions is the empty list, Xorg chooses an appropriate screen resolution. Otherwise, it must be a list of resolutions—e.g., ((1024 768) (640 480)).

keyboard-layout (default: #f)

If this is #f, Xorg uses the default keyboard layout—usually US English (“qwerty”) for a 105-key PC keyboard.

Otherwise this must be a keyboard-layout object specifying the keyboard layout in use when Xorg is running. See Keyboard Layout, for more information on how to specify the keyboard layout.

extra-config (default: '())

This is a list of strings or objects appended to the configuration file. It is used to pass extra text to be added verbatim to the configuration file.

server (default: xorg-server)

This is the package providing the Xorg server.

server-arguments (default: %default-xorg-server-arguments)

This is the list of command-line arguments to pass to the X server. The default is -nolisten tcp.

Scheme Procedure: set-xorg-configuration config [login-manager-service-type]

Tell the log-in manager (of type login-manager-service-type) to use config, an <xorg-configuration> record.

Since the Xorg configuration is embedded in the log-in manager’s configuration—e.g., gdm-configuration—this procedure provides a shorthand to set the Xorg configuration.

Scheme Procedure: xorg-start-command [config]

Return a startx script in which the modules, fonts, etc. specified in config, are available. The result should be used in place of startx.

Usually the X server is started by a login manager.

Scheme Procedure: screen-locker-service package [program]

Add package, a package for a screen locker or screen saver whose command is program, to the set of setuid programs and add a PAM entry for it. For example:

(screen-locker-service xlockmore "xlock")

makes the good ol’ XlockMore usable.


Next: , Previous: , Up: Services   [Contents][Index]