colord - How do I use colord?

Back to the main page

# How do I use colord?

## Using the command line

The `colormgr` text-mode program allows you to interact with colord on the command line. For example:

    [hughsie@hughsie-work ~]$ colormgr get-devices
    Object Path: /org/freedesktop/ColorManager/devices/sysfs_Chicony_Electronics_Co___Ltd__Integrated_Camera
    Created:        1310115220
    Modified:       1310115220
    Kind:           webcam
    Model:          Webcam
    Vendor:         Chicony Electronics
    Serial:         /sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.6/1-1.6:1.0/video4linux/video0
    Colorspace:     rgb
    Device ID:      sysfs-Chicony_Electronics_Co.__Ltd.-Integrated_Camera
    Metadata:       CMS=colord

    Object Path:    /org/freedesktop/ColorManager/devices/sane_Photosmart_B109a_m
    Created:        1310115222
    Modified:       1310115222
    Kind:           scanner
    Model:          Photosmart B109a-m
    Vendor:         Hewlett Packard
    Serial:         hpaio:/usb/Photosmart_B109a-m?serial=MY97J4210M05C7
    Colorspace:     rgb
    Device ID:      sane-Photosmart_B109a-m
    Metadata:       CMS=colord

    Object Path:    /org/freedesktop/ColorManager/devices/cups_Photosmart_B109a_m
    Created:        1310115222
    Modified:       1310115222
    Kind:           printer
    Model:          Photosmart-B109a-m
    Vendor:         Hewlett Packard
    Serial:         hp:/usb/Photosmart_B109a-m?serial=MY97J4210M05C7
    Scope:          temp
    Colorspace:     rgb
    Device ID:      cups-Photosmart-B109a-m
    Profile 1:      /org/freedesktop/ColorManager/profiles/GCM_HP_HP_Deskjet_d1300_Series_2010_02_25__
    Profile 2:      /org/freedesktop/ColorManager/profiles/Photosmart_B109a_m_RGB__
    Profile 3:      /org/freedesktop/ColorManager/profiles/Photosmart_B109a_m_Gray__
    Metadata:       CMS=colord

    Object Path:    /org/freedesktop/ColorManager/devices/xrandr_Lenovo_Group_Limited
    Created:        1310115227
    Modified:       1310115227
    Kind:           display
    Model:          4384BR2
    Vendor:         Lenovo
    Serial:         unknown
    Scope:          temp
    Colorspace:     rgb
    Device ID:      xrandr-Lenovo Group Limited
    Profile 1:      /org/freedesktop/ColorManager/profiles/icc_b634b0aed98b073e1f1e853dde389eef
    Profile 2:      /org/freedesktop/ColorManager/profiles/icc_e3844d7f2dd36e1878acff8d77107aa4
    Profile 3:      /org/freedesktop/ColorManager/profiles/icc_2304ec478dad248e0dd01ff2cc50940a
    Profile 4:      /org/freedesktop/ColorManager/profiles/icc_d814dde3a76b05c47aa5fd16e7000639
    Profile 5:      /org/freedesktop/ColorManager/profiles/icc_64eb9372fae294a7cf2e4c5bd3ab9590
    Profile 6:      /org/freedesktop/ColorManager/profiles/icc_0f23f3fc3156fa9b2998c2ebe33ce54d
    Metadata:       XRANDR_name=LVDS1

    Object Path:    /org/freedesktop/ColorManager/devices/xrandr_Hewlett_Packard_HP_LP2480zx_3CM82200KV
    Created:        1310115227
    Modified:       1310115227
    Kind:           display
    Model:          HP LP2480zx
    Vendor:         Hewlett Packard
    Serial:         3CM82200KV
    Scope:          temp
    Colorspace:     rgb
    Device ID:      xrandr-Hewlett Packard-HP LP2480zx-3CM82200KV
    Profile 1:      /org/freedesktop/ColorManager/profiles/icc_d3b85708ae5843001de0801773b57246
    Profile 2:      /org/freedesktop/ColorManager/profiles/icc_2ab7d3493c09663df7cbfa03cd8e006f
    Metadata:       XRANDR_name=HDMI2

or

    [hughsie@hughsie-work ~]$ colormgr --help
    Usage:
      colormgr [OPTION...]

      create-device                      Create a device
      create-profile                     Create a profile
      delete-device                      Deletes a device
      delete-profile                     Deletes a profile
      device-add-profile                 Add a profile to a device
      device-get-default-profile         Gets the default profile for a device
      device-get-profile-for-qualifier   Returns all the profiles that match a qualifier
      device-make-profile-default        Makes a profile default for a device
      device-set-kind                    Sets the device kind
      device-set-model                   Sets the device model
      device-set-serial                  Sets the device serial
      device-set-vendor                  Sets the device vendor
      find-device                        Find a device
      find-device-by-property            Find a device that has a specific property
      find-profile                       Find a profile
      find-profile-by-filename           Find a profile by filename
      get-devices                        Gets all the color managed devices
      get-devices-by-kind                Gets all the color managed devices of a specific kind
      get-profiles                       Gets all the available color profiles
      get-sensor-reading                 Gets a reading from a sensor
      get-sensors                        Gets all the available color sensors
      get-standard-space                 Get a standard colorspace
      profile-set-filename               Sets the profile filename
      profile-set-qualifier              Sets the profile qualifier
      sensor-lock                        Locks the color sensor

    Help Options:
      -h, --help       Show help options

## Using graphical tools:

GNOME and KDE both provides a rich set of GTK and QT tools for automatically managing color devices and profiles. See the screenshots page for more details.

## Using libcolord:

The libcolord gobject library wraps the D-Bus interface in a nice glib-style API. This makes designing programs that use libcolord can concentrate on core functionality rather that the D-Bus and colord internals. CdClient in libcolord can be used as easily as:

    CdClient *client;
    GError *error;
    GPtrArray *devices;
    client = cd_client_new ();
    devices = cd_client_get_devices_sync (client, cancellable, &error);
    g_object_unref (client);
    g_ptr_array_unref (devices);

The latest documentation for libcolord is available here.

## Using the raw D-Bus API:

Using the D-Bus methods and signals directly means that no glib or gobject dependency is needed. This is not difficult, although does require more code than just using libcolord. See these files for examples cd-dbus-create-device.c and cd-dbus-use-qualifier.c. The latest interface description is available in the generated help pages.

Back to the main page