|
|
|
|
10.2 Managing Profiles Manually
If you prefer manually editing configuration files over using a graphical
tool, the KIOSK framework lets you do this, too. Every configuration file in
a profile is a plain text file that can be edited with the editor of your
choice. KIOSK's configuration and deployment options are described in detail
in The KDE Source Repository at https://websvn.kde.org/trunk/KDE/kdelibs/kdecore/README.kiosk?view=markup.
Refer to this resource for details. In the following, only the
fundamentals needed to use the KIOSK framework are described.
10.2.1 File System Hierarchy
KDE reads and stores files used by the KDE environment itself as well as by
the KDE applications in fixed directory trees, also referred to as
profiles in this context. By default, there are two such
directories: /opt/kde3 and
~/.kde. The ~/.kde directory
contains
the user-specific settings. The /opt/kde3 directory
contains data and
configuration files that came with the packages. It is not recommended to
make any changes there, because they get overwritten with the next
update. Therefore, as a system administrator you can create additional
trees that are used by the KIOSK framework. The default location for an
additional fixed directory tree is
/var/lib/kde-profiles. You can add custom locations in
/etc/kde3rc. Refer to the KIOSK documentation
for details.
A fixed directory tree consists of the following directories (although not
all directories need to be present):
- bin
-
Executables
- cgi-bin
-
Help center scripts
- lib
-
Libraries
- socket-<HOSTNAME>
-
Communication sockets
- tmp-<HOSTNAME>
-
Temporary files
- cache-<HOSTNAME>
-
Cached data
- share
-
Application and configuration data
Among others, the share directory contains the
following subdirectories:
- share/applications
-
.desktop files for all applications appearing in the KDE menu
- share/applnk
-
The KDE menu structure
- share/config
-
Configuration files for applications and components as well as the
global configuration file kdeglobals
- share/icons
-
Icons, categorized by theme, dimension, and usage category
- share/mimelnk
-
.desktop files with mime types
- share/wallpapers
-
Images that can be used as background pictures
Precedence
KDE scans all directory trees known to the system. When a specific file is
present in multiple directory trees, the order of precedence determines
which file is used.
When configuration files are scanned, an additional rule
applies. Generally,
the contents of multiple configuration files with the same name are
merged. However, if the same configuration key is defined more than once,
the key from the file with the highest precedence determines which value
is used.
The rule of precedence is:
-
User directory (~/.kde)
-
Directories configured in /etc/kde3rc
-
Systemwide default directory (/opt/kde3)
As a user, you can overwrite this order by setting the variable
$KDEDIRS. Directories should be separated by a colon
(:). The first directory has highest precedence and the
last one lowest precedence.
10.2.2 Configuration File Format
KDE configurations are stored in text files in UTF-8 format. Each
configuration option consists of a key and value pair and is placed inside
a group:
[Group 1]
key=value
key 2=value 2
White space at the beginning or end of keys and values are
ignored. However, both may contain spaces as shown in the example
above. If a value is supposed to start or end with space or should
contain line breaks or special characters, use the following
special codes:
-
\s: space
-
\t: tab
-
\r: carriage return
-
\n: new line
-
\\: backslash
Shell Expansion
To use dynamically generated values, KDE allows you to use
shell expansions. If a key is followed by
[$e], shell expansions are activated.
When using this construct, the value is written to the file the first time
it is read. Using [$ie], lock down this behavior
so the expansion is evaluated every time the configuration file is
read. Shell expansions allow you to either use
environment variables or the output of commands as values.
[example group]
UserName=$USER
Group=$(id -g)
HomeDirectory=$HOME
Localization
All configuration values can be localized with a language code added to
the key entry:
[example group]
Label=Language
Label[de]=Sprache
Label[ru]=Язык
Configuration Entry Lock Down
All configuration entries can be protected from being overwritten. You can
lock down entire configuration files, groups, or individual
keys. Do this by adding [Si] on a separate line at the
beginning of a file, placing it behind the group name, or adding it
behind a key.
[example group][$i]
Label=Language
[example group 2]
UserName[$i]=$USER
10.2.3 Activating Profiles
Profiles can be created anywhere in the
file system. To make the KDE environment read your profiles, you
must make them known to the system in /etc/kde3rc. The
default profile location /var/lib/kde-profiles/ is
already configured there.
By default, a custom profile is not associated to users or groups. You
can make this association in the user profile map file at
/etc/kde-user-profile. The only exception from this is
the default profile. If you create a profile named default
under /var/lib/kde-profiles/ this is automatically
associated to all users on this machine (such a profile does not exist by
default).
Find more detailed information about activating profiles and mapping them
to users in the KIOSK framework documentation.
10.2.4 Examples
SUSE Linux Enterprise comes with three predefined profiles (redmond, simplified, and
Thinclient) located in /var/lib/kde-profiles. You
may use one of these as a template for your own profile.
|
|
|