<?xml version="1.0" encoding="utf-8"?>
<chapter id="mate-dconf" lang="da">

  <title>Desktop Settings Storage</title>

  <highlights>
    <para>
      This chapter describes how are your MATE desktop settings stored,
      and how to retrieve or modify them using the <command>dconf</command>
      or <command>gsettings</command> command line tools, or the
      <application>Dconf Editor</application> GUI application.
    </para>
  </highlights>

  <sect1 id="mate-dconf-intro">
    <title>Introduktion</title>

    <para>
      The settings of your MATE desktop are managed and stored by
      <application>dconf</application>, which is a key-based configuration system
      for hardware and software configurations.
    </para>

    <para>
      <application>dconf</application> uses several database files in GVDB binary format, one database per file.
      A dconf profile consists of a single file, in plain text format, which contains a list of database files in GVDB format.
      All dconf profiles are stored in the <filename class="directory">/etc/dconf/profile</filename> folder.
    </para>
    <para>
      In most systems, there is no dconf profile file since they only use the default database, user.db which is stored in ~/.config/dconf/user. In such case, there is no system-wide setting, i.e. users just have their own settings.
    </para>
    <para>
      Example of content for the user profile (/etc/dconf/profile/user file):
    </para>

<literallayout>user-db: user
system-db: local
system-db: site
system-db: distro</literallayout>

    <para>
      The previous dconf profile contains 4 GVDB files, one per line.
    </para>

    <itemizedlist>
      <listitem>
        <para><database class="name">user</database> is the name of the user's databases. They are usually located in the <filename class="directory">~/.config/dconf</filename> folder</para>
      </listitem>
      <listitem>
        <para><database class="name">local</database>, <database class="name">site</database> and <database class="name">distro</database> are system databases. They are usually located in the <filename class="directory">/etc/dconf/db</filename> folder</para>
      </listitem>
    </itemizedlist>

    <para>
      Each one of these databases store key-value pairs using a hash map data structure, which can map string keys to GVariant values in a way that is extremely efficient for lookups.
      The lookup preference is determined by the order of appearance in the dconf profile file, user's databases have the highest preference in the previous dconf profile example.
      The keys from multiple configuration sources coexist in a logical tree structure. MATE Desktop key-value hashmap entries are under the /org/mate logical node, which are usually stored in user's databases.
    </para>

    <note>
      <para>Refer to the <ulink url="man:dconf(7)" type="man"><citerefentry><refentrytitle>dconf</refentrytitle><manvolnum>7</manvolnum></citerefentry></ulink> for more information about the dconf configuration system.</para>
    </note>

  <sect2 id="mate-dconf-one-read">
    <title>To read the value of a dconf key</title>

    <para>Værdien af en dconf-nøgle kan læses via kommandolinjeværktøjerne <command>dconf</command> eller  <command>gsettings</command>, eller det grafiske program <application>Dconf Editor</application>.</para>

    <para>Dette afsnit viser hvordan du læser baggrundsbilledet på dit MATE-skrivebord, denne værdi lagres i dconf-nøglen:</para>
    <itemizedlist>
      <listitem>
        <para>/org/mate/desktop/background/picture-filename</para>
      </listitem>
    </itemizedlist>

    <para>
      The following figure displays the full path to this dconf key. Note that the other directories have not been expanded, or they have been removed, and only are showed the keys for dconf directory:
    </para>

    <itemizedlist>
      <listitem>
        <para>/org/mate/desktop/background/</para>
      </listitem>
    </itemizedlist>

    <figure id="dconf-logical-full-bakgroud-keys-fig">
      <title>/org/mate/desktop/background/ dconf directory</title> 
      <mediaobject><imageobject> <imagedata fileref="figures/org_mate_desktop_background_logical_view.png" format="PNG"/> </imageobject> <textobject> <phrase>Figur der viser indholdet af dconf-mappen /org/mate/desktop/background/</phrase> </textobject></mediaobject>
    </figure>

    <para>Du kan læse værdien af en dconf-nøgle:</para>

    <sect3 id="read-key-dconf-using-dconf-editor">
      <title>Brug af det grafiske brugerfladeprogram dconf-editor</title>
      <para>For at vise værdien af en dconf-nøgle via programmet <application>Dconf Editor</application>, udfør de følgende trin:</para>
      <orderedlist>
        <listitem>
          <para>Vælg <menuchoice><guimenu>Programmer</guimenu><guimenuitem>Systemværktøjer</guimenuitem><guimenuitem>dconf Editor</guimenuitem></menuchoice> fra toppanelet.</para>
        </listitem>
        <listitem>
          <para>Klik på mapperne for at få den fulde sti til dconf-mappen.</para>
        </listitem>
      </orderedlist>

      <figure>
        <title>Dconf-Editor viser værdien for nøglen /org/mate/desktop/background/picture-filename</title>
        <screenshot>
          <mediaobject><imageobject> <imagedata fileref="figures/picture_filename_dconf_key_view.png" format="PNG"/> </imageobject> <textobject> <phrase>Dconf-Editor viser værdien for nøglen /org/mate/desktop/background/picture-filename</phrase> </textobject></mediaobject>
        </screenshot>
      </figure>
    </sect3>

    <sect3 id="read-key-dconf-using-dconf">
      <title>Brug af kommandolinjeværktøjet dconf</title>
      <para>For at læse værdien af en dconf-nøgle via kommandolinjeværktøjet <command>dconf</command>, kør den følgende kommando:</para>
      <screen>$ dconf read /org/mate/desktop/background/picture-filename
'/usr/share/backgrounds/mate/desktop/MATE-Stripes-Dark.png'</screen>
      <para>Synopsis:</para>
      <synopsis>dconf read [-d] NØGLE</synopsis>
      <para>Se <ulink url="man:dconf" type="man"><citerefentry><refentrytitle>dconf</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink> for yderligere information om hvordan kommandolinjeværktøjet <command>dconf</command> bruges.</para>
      <tip><para>Du kan bruge tasten <keycap>Indryk</keycap> til automatisk at fuldføre stien til dconf-nøglen.</para></tip>
    </sect3>

    <sect3 id="read-key-dconf-using-gsettings">
      <title>Brug af kommandolinjeværktøjet gsettings</title>
      <para>
        To read the value of a dconf key using the <command>gsettings</command> command line tool, run the following command:
      </para>
      <screen>$ gsettings get org.mate.background picture-filename
'/usr/share/backgrounds/mate/desktop/MATE-Stripes-Dark.png'</screen>
      <para>Synopsis:</para>
      <synopsis>gsettings [--schemadir SCHEMADIR] get SCHEMA[:PATH] KEY</synopsis>
      <para>Se <ulink url="man:gsettings" type="man"><citerefentry><refentrytitle>gsettings</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink> for yderligere information om hvordan kommandolinjeværktøjet <command>gsettings</command> skal bruges.</para>
    </sect3>
  </sect2>

  <sect2 id="mate-dconf-one-change">
    <title>For at ændre værdien af en dconf-nøgle</title>

    <para>Værdien af en dconf-nøgle kan ændres via kommandoen <command>dconf</command> eller programmet <application>Dconf Editor</application>.</para>
    <para>Dette afsnit viser hvordan du ændrer baggrundsbilledet på dit MATE-skrivebord, denne værdi lagres i dconf-nøglen:</para>
    <itemizedlist>
      <listitem>
        <para>/org/mate/desktop/background/picture-filename</para>
      </listitem>
    </itemizedlist>

    <para>
      The following figure displays the full path to this dconf key. Note that the other directories have not been expanded, or they have been removed, and only are showed the keys for dconf directory:
    </para>
    <itemizedlist>
      <listitem>
        <para>/org/mate/desktop/background/</para>
      </listitem>
    </itemizedlist>

    <figure id="dconf-logical-short-bakgroud-keys-fig">
      <title>/org/mate/desktop/background/ dconf directory</title>
      <mediaobject><imageobject> <imagedata fileref="figures/org_mate_desktop_background_only_logical_view.png" format="PNG"/> </imageobject> <textobject> <phrase>Figur der viser indholdet af dconf-mappen /org/mate/desktop/background/</phrase> </textobject></mediaobject>
    </figure>

    <para>Du kan ændre værdien af en dconf-nøgle:</para>

    <sect3 id="modify-key-dconf-using-dconf-editor">
      <title>Brug af det grafiske brugerfladeprogram dconf-editor</title>
      <para>For at redigere baggrundsbilledet for dit MATE-skrivebord i <application>Dconf Editor</application>, udfør de følgende trin:</para>

      <orderedlist>
        <listitem>
            <para>Vælg <menuchoice><guimenu>Programmer</guimenu><guimenuitem>Systemværktøjer</guimenuitem><guimenuitem>dconf Editor</guimenuitem></menuchoice> fra toppanelet.</para>
        </listitem>
        <listitem>
          <para>Klik på mapperne for at få den fuldt sti til dconf-mappen og klik så på dconf-nøglen for at redigere dens værdi.</para>
        </listitem>
        <listitem>
           <para>Indtast den nye værdi i tekstboksen <guilabel>Tilpasset værdi</guilabel>.</para>
        </listitem>
        <listitem>
           <para>Click on the Check mark button to apply the change.</para>
        </listitem>
      </orderedlist>

      <figure>
        <title>Redigering af værdien på nøglen /org/mate/desktop/background/picture-filename i Dconf-Editor-dialogen</title>
        <screenshot>
          <mediaobject><imageobject> <imagedata fileref="figures/picture_filename_dconf_key_edit.png" format="PNG"/> </imageobject> <textobject> <phrase>Redigering af værdien på nøglen /org/mate/desktop/background/picture-filename i Dconf-Editor-dialogen</phrase> </textobject></mediaobject>
        </screenshot>
      </figure>
    </sect3>

    <sect3 id="modify-key-dconf-using-dconf">
      <title>Brug af kommandolinjeværktøjet dconf</title>
      <para>For at ændre baggrundsbilledet i MATE-skrivebordet køres den følgende kommando:</para>
      <screen>$ dconf write /org/mate/desktop/background/picture-filename \
"'/usr/share/backgrounds/mate/desktop/MATE-Stripes-Light.png'"</screen>
      <para>Synopsis:</para>
      <synopsis>dconf write NØGLEVÆRDI</synopsis>
      <para>Se <ulink url="man:dconf" type="man"><citerefentry><refentrytitle>dconf</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink> for yderligere information om hvordan kommandolinjeværktøjet <command>dconf</command> bruges.</para>
    </sect3>

    <sect3 id="modify-key-dconf-using-gsettings">
      <title>Brug af kommandolinjeværktøjet gsettings</title>
      <para>For at ændre baggrundsbilledet i MATE-skrivebordet køres den følgende kommando:</para>
      <screen>$ gsettings set org.mate.background picture-filename \
"'/usr/share/backgrounds/mate/desktop/MATE-Stripes-Light.png'"</screen>
      <para>Synopsis:</para>
      <synopsis>gsettings [--schemadir SCHEMADIR] set SCHEMA[:PATH] KEY VALUE</synopsis>
      <para>Se <ulink url="man:gsettings" type="man"><citerefentry><refentrytitle>gsettings</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink> for yderligere information om hvordan <command>dconf</command> bruges.</para>
    </sect3>
  </sect2>

  <sect2 id="mate-dconf-some-changes">
    <title>For at ændre værdien af flere dconf-nøgler</title>

    <para>For at ændre værdien af flere dconf-nøgler på samme tid, udfør de følgende trin:</para>
    <orderedlist>
      <listitem>
        <para>Dump indholdet af en dconf-mappe til en ny ren tekst-fil:</para>
        <screen>$ dconf dump /org/mate/desktop/background/ &gt; file.dconf</screen>
      </listitem>
      <listitem>
        <para>Lav ændringer i tekstfilen</para>
<literallayout>[/]
color-shading-type='vertical-gradient'
primary-color='rgb(88,145,188)'
picture-options='zoom'
picture-filename='/usr/share/backgrounds/mate/desktop/MATE-Stripes-Light.png'
secondary-color='rgb(60,143,37)'
</literallayout>
      </listitem>
      <listitem>
        <para>Indlæs indholdet af tekstfilen til en dconf-mappe</para>
        <screen>$ dconf load /org/mate/desktop/background/ &lt; file.dconf</screen>
      </listitem>
    </orderedlist>
    <tip><para>Du kan også dumpe/indlæse flere mapper på samem tid, f.eks. for at lave sikkerhedskopier og gendanne alle konfigurationer i dit MATE-skrivebord:</para>
        <screen>$ dconf dump /org/mate/ &gt; backup.dconf
$ dconf load /org/mate/ &lt; backup.dconf</screen>
    </tip>

    <para>Se <ulink url="man:dconf" type="man"><citerefentry><refentrytitle>dconf</refentrytitle><manvolnum>1</manvolnum></citerefentry></ulink> for yderligere information om hvordan kommandolinjeværktøjet <command>dconf</command> bruges.</para>

  </sect2>

  </sect1>

  <include xmlns="http://www.w3.org/2001/XInclude" href="gosdconfkeys.xml"/>   <!-- List of dconf keys -->

</chapter>
