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


13.3.8 Desktop Home Services

The (gnu home services desktop) module provides services that you may find useful on “desktop” systems running a graphical user environment such as Xorg.

Variable: home-x11-service-type

This is the service type representing the X Window graphical display server (also referred to as “X11”).

X Window is necessarily started by a system service; on Guix System, starting it is the responsibility of gdm-service-type and similar services (see X Window). At the level of Guix Home, as an unprivileged user, we cannot start X Window; all we can do is check whether it is running. This is what this service does.

As a user, you probably don’t need to worry or explicitly instantiate home-x11-service-type. Services that require an X Window graphical display, such as home-redshift-service-type below, instantiate it and depend on its corresponding x11-display Shepherd service (see Managing User Daemons).

When X Window is running, the x11-display Shepherd service starts and sets the DISPLAY environment variable of the shepherd process, using its original value if it was already set; otherwise, it fails to start.

The service can also be forced to use a given value for DISPLAY, like so:

herd start x11-display :3

In the example above, x11-display is instructed to set DISPLAY to :3.

Variable: home-redshift-service-type

This is the service type for Redshift, a program that adjusts the display color temperature according to the time of day. Its associated value must be a home-redshift-configuration record, as shown below.

A typical configuration, where we manually specify the latitude and longitude, might look like this:

(service home-redshift-service-type
         (home-redshift-configuration
          (location-provider 'manual)
          (latitude 35.81)    ;northern hemisphere
          (longitude -0.80))) ;west of Greenwich
Data Type: home-redshift-configuration

Available home-redshift-configuration fields are:

redshift (default: redshift) (type: file-like)

Redshift package to use.

location-provider (default: geoclue2) (type: symbol)

Geolocation provider—'manual or 'geoclue2. In the former case, you must also specify the latitude and longitude fields so Redshift can determine daytime at your place. In the latter case, the Geoclue system service must be running; it will be queried for location information.

adjustment-method (default: randr) (type: symbol)

Color adjustment method.

daytime-temperature (default: 6500) (type: integer)

Daytime color temperature (kelvins).

nighttime-temperature (default: 4500) (type: integer)

Nighttime color temperature (kelvins).

daytime-brightness (type: maybe-inexact-number)

Daytime screen brightness, between 0.1 and 1.0, or left unspecified.

nighttime-brightness (type: maybe-inexact-number)

Nighttime screen brightness, between 0.1 and 1.0, or left unspecified.

latitude (type: maybe-inexact-number)

Latitude, when location-provider is 'manual.

longitude (type: maybe-inexact-number)

Longitude, when location-provider is 'manual.

dawn-time (type: maybe-string)

Custom time for the transition from night to day in the morning—"HH:MM" format. When specified, solar elevation is not used to determine the daytime/nighttime period.

dusk-time (type: maybe-string)

Likewise, custom time for the transition from day to night in the evening.

extra-content (default: "") (type: raw-configuration-string)

Extra content appended as-is to the Redshift configuration file. Run man redshift for more information about the configuration file format.

Variable: home-dbus-service-type

This is the service type for running a session-specific D-Bus, for unprivileged applications that require D-Bus to be running.

Data Type: home-dbus-configuration

The configuration record for home-dbus-service-type.

dbus (default: dbus)

The package providing the /bin/dbus-daemon command.

Variable: home-unclutter-service-type

This is the service type for Unclutter, a program that runs on the background of an X11 session and detects when the X pointer hasn’t moved for a specified idle timeout, after which it hides the cursor so that you can focus on the text underneath. Its associated value must be a home-unclutter-configuration record, as shown below.

A typical configuration, where we manually specify the idle timeout (in seconds), might look like this:

Data Type: home-unclutter-configuration

The configuration record for home-unclutter-service-type.

unclutter (default: unclutter) (type: file-like)

Unclutter package to use.

idle-timeout (default: 5) (type: integer)

A timeout in seconds after which to hide cursor.

Variable: home-xmodmap-service-type

This is the service type for the xmodmap utility to modify keymaps and pointer button mappings under the Xorg display server. Its associated value must be a home-xmodmap-configuration record, as shown below.

The key-map field takes a list of objects, each of which is either a statement (a string) or an assignment (a pair of strings). As an example, the snippet below swaps around the Caps_Lock and the Control_L keys, by first removing the keysyms (on the right-hand side) from the corresponding modifier maps (on the left-hand side), re-assigning them by swapping each other out, and finally adding back the keysyms to the modifier maps.

(service home-xmodmap-service-type
         (home-xmodmap-configuration
          (key-map '(("remove Lock" . "Caps_Lock")
                     ("remove Control" . "Control_L")
                     ("keysym Control_L" . "Caps_Lock")
                     ("keysym Caps_Lock" . "Control_L")
                     ("add Lock" . "Caps_Lock")
                     ("add Control" . "Control_L")))))
Data Type: home-xmodmap-configuration

The configuration record for home-xmodmap-service-type. Its available fields are:

xmodmap (default: xmodmap) (type: file-like)

The xmodmap package to use.

key-map (default: '()) (type: list)

The list of expressions to be read by xmodmap on service startup.

Variable: home-startx-command-service-type

Add startx to the home profile putting it onto PATH.

The value for this service is a <xorg-configuration> object which is passed to the xorg-start-command-xinit procedure producing the startx used. Default value is (xorg-configuration).


Next: Guix Home Services, Previous: GNU Privacy Guard, Up: Home Services   [Contents][Index]