Difference between revisions of "KDE System Administration/Environment Variables"

Jump to: navigation, search
(Document commit r709350 by Olivier)
(KDE_COLOR_DEBUG_ALWAYS: added it)
 
(11 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 +
 
== Introduction ==
 
== Introduction ==
 
There are numerous environment variables that are useful when managing and controlling a KDE environment. Supported environment variables are listed below.
 
There are numerous environment variables that are useful when managing and controlling a KDE environment. Supported environment variables are listed below.
Line 5: Line 6:
  
 
=== KDE_FULL_SESSION  ===
 
=== KDE_FULL_SESSION  ===
Set to true by KDE startup, it is used by e.g. Konqueror to know if it should consider remaining in memory for future re-use when being closed. If not set, konqueror will exit after being closed (e.g. kdesu does that, it's also useful for debugging).
+
Set to true by KDE startup, it is used by some programs, such as Konqueror, to know if they should consider remaining in memory for future re-use when being closed. If not set, those programs will exit after being closed (e.g. kdesu does that, it's also useful for debugging).
  
If you plan on using this variable to detect a running KDE session, it is safest to check if the value is not empty (i.e. test -n "$KDE_FULL_SESSION") instead of seeing if it equals true.  This allows for changing the value of the variable to include KDE version info or other uses.
+
If you plan on using this variable to detect a running KDE session, check if the value is not empty instead of seeing if it equals true.  The value might be changed in the future to include KDE version information.
  
 
=== KDE_SESSION_VERSION ===
 
=== KDE_SESSION_VERSION ===
Introduced in KDE4, this environment variable is set to the major version number of the KDE desktop being run on startup. This allows one to know which <tt>kde?-config</tt> to run: <tt>kde${KDE_SESSION_VERSION}-config</tt>. For KDE3 this will resolve to <tt>kde-config</tt> and for KDE4 this will result in <tt>kde4-config</tt>. One can then use this knowledge to query more details as to the minor version, prefixes, etc.
+
Introduced in KDE4, this environment variable is set to the major version number of the KDE desktop being run on startup. This allows one to know which <tt>kde?-config</tt> to run: <tt>kde${KDE_SESSION_VERSION}-config</tt>. For KDE3 this will resolve to <tt>kde-config</tt> and for KDE4 this will result in <tt>kde4-config</tt>. One can then use this knowledge to query more details, such as the minor version, prefixes, etc.
  
 
== Display and Window Management ==
 
== Display and Window Management ==
  
 
=== KDEWM ===
 
=== KDEWM ===
If the KDEWM environment variable has been set, then it will be used as KDE's window manager within the startkde script instead of kwin.
+
If the KDEWM environment variable has been set, then its value will be used instead of <tt>kwin</tt> as KDE's window manager within the startkde script.
 
   
 
   
 
=== KDE_DISPLAY ===
 
=== KDE_DISPLAY ===
Line 21: Line 22:
 
   
 
   
 
=== KDE_MULTIHEAD ===
 
=== KDE_MULTIHEAD ===
Set this variable to "true" to indicate that KDE is running on a multi-head system.
+
Set this variable to true to indicate that KDE is running on a multi-head system.
 
   
 
   
  
Line 29: Line 30:
 
Overrides KDEDIR and allows you to specify multiple directories where KDE searches for its data. Useful if you want or have to install some programs to a different prefix than the rest of your KDE.
 
Overrides KDEDIR and allows you to specify multiple directories where KDE searches for its data. Useful if you want or have to install some programs to a different prefix than the rest of your KDE.
 
   
 
   
Please note, that at least the startkde script expects the KDE install directory to be listed as first.
+
Please note that at least the startkde script expects the KDE install directory to be listed first.
 
   
 
   
 
=== KDEHOME ===
 
=== KDEHOME ===
Line 35: Line 36:
 
   
 
   
 
=== KDE_HOME_READONLY ===
 
=== KDE_HOME_READONLY ===
Set this variable to indicate that your home directory is mounted as read-only.
+
Set this variable to indicate that your home directory is mounted read-only.
  
 
=== KDEROOTHOME ===
 
=== KDEROOTHOME ===
If not set, KDE uses ~root/.kde as directory for root's personal data. Was introduced to prevent KDE from accidently overwriting user data with root permission when user run a KDE program after switching with "su" to root.
+
If not set, KDE uses ~root/.kde for root's personal data. This was introduced to prevent KDE from accidentally overwriting user data with root permissions when a user runs a KDE program after switching to root with "su".
  
 
=== KDESYCOCA ===
 
=== KDESYCOCA ===
Allows to specify the path and the name of the generated KDE system configuration cache file.
+
Allows you to specify the path and the name of the generated KDE configuration cache file.
 
   
 
   
 
=== KDETMP ===
 
=== KDETMP ===
Allows to specify another path than /tmp where KDE stores its temporary files.
+
Allows you to specify a path other than /tmp for KDE to store its temporary files.
+
 
 
=== KDEVARTMP ===
 
=== KDEVARTMP ===
Allows to specify another path than /var/tmp where KDE stores its variable files.
+
Allows you to specify a path other than /var/tmp for KDE to store its variable files.
  
 
== Localization ==
 
== Localization ==
  
 
=== KDE_LANG ===
 
=== KDE_LANG ===
Overrides the KDE language configuration, e.g. "KDE_LANG=fr kprogram &" starts a program with french translation if the necessary files are installed.
+
Allows you to override the KDE language configuration.  For example, "KDE_LANG=fr kprogram &" starts a program in French if the necessary files are installed.
  
 
=== KDE_UTF8_FILENAMES ===
 
=== KDE_UTF8_FILENAMES ===
If this environment variable is set, KDE assumes all filenames are in UTF-8 encoding regardless of the current C locale.
+
If this environment variable is set, KDE assumes all filenames are in UTF-8 encoding, regardless of the current C locale.
  
 
== Networking ==
 
== Networking ==
Line 74: Line 75:
  
 
=== KDE_NOUNLOAD ===
 
=== KDE_NOUNLOAD ===
If this variable is set then KLibLoader is told to never unload dynamically opened libraries.
+
If this variable is set, then KLibLoader is told to never unload dynamically opened libraries.
 
   
 
   
 
=== KDE_DOUNLOAD ===
 
=== KDE_DOUNLOAD ===
If this variable is set then KLibLoader is told to always try to unload dynamically opened libraries. Warning, this will most probably lead to crashes!
+
If this variable is set, then KLibLoader is told to always try to unload dynamically opened libraries. Warning, this will most probably lead to crashes!
  
 
== Troubleshooting and Debugging ==  
 
== Troubleshooting and Debugging ==  
  
 
=== KDE_DEBUG ===
 
=== KDE_DEBUG ===
Set this variable to disable the KDE crash handler (same as --nocrashhandler command line option).
+
Setting this variable disables KDE's crash handler DrKonqi and instead lets the application create a [http://en.wikipedia.org/wiki/Core_dump core dump]. This allows post mortem debugging. An alternative to KDE_DEBUG is launching the application with the command line option <tt>--nocrashhandler</tt>. Setting <tt>ulimit -c 0</tt> will also prevent core dumps.
 +
 
 +
=== KDE_DEBUG_NOPROCESSINFO ===
 +
Normally the current program name will be shown on every line of KDebug output. Setting this variable hides it.
 +
 
 +
=== KDE_DEBUG_NOAREANAME ===
 +
Normally the current KDebug area will be shown on every line of KDebug output. Setting this variable hides it.
 +
 
 +
=== KDE_DEBUG_NOMETHODNAME ===
 +
Normally the current method name will be shown on every line of KDebug output. Setting this variable hides it.
 +
 
 +
=== KDE_DEBUG_FILELINE ===
 +
Setting this variable adds the source file and line number to every line of KDebug output. Since kdelibs-4.6.
 +
 
 +
The source file is shown relative to the top of the project directory, provided that add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) is used in the application's CMakeLists.txt
 +
 
 +
=== KDE_DEBUG_TIMESTAMP ===
 +
Setting this variable to "1" adds a HH:MM:SS timestamp to every line of KDebug output. Setting the variable to "2" adds millisecond accuracy to the timestamp.
  
 
=== KDE_COLOR_DEBUG ===
 
=== KDE_COLOR_DEBUG ===
Starting from KDE 4, set this variable to get colourful debug output which will look nicely in Konsole.
+
Starting with KDE 4, setting this variable will get you colorful debug output.
+
 
 +
=== KDE_COLOR_DEBUG_ALWAYS ===
 +
KDE_COLOR_DEBUG does not provide coloured debug messages for processes spawned by the main process. With this all debug messages will be coloured.
 +
 
 
=== KDE_FORK_SLAVES ===
 
=== KDE_FORK_SLAVES ===
Set this variable to spawn KIO-slaves directly from the application process itself, by default KIO-slaves are spawned using klauncher/kdeinit. This option is useful if the KIO-slave should run in the same environment as the application, this can be the case with Clearcase.
+
Set this variable to spawn KIO-slaves directly from the application process itself. (By default, KIO-slaves are spawned using klauncher/kdeinit.) This option is useful if the KIO-slave should run in the same environment as the application; this can be the case with Clearcase.
 +
 
 +
== Look and feel ==
 +
 
 +
The following environment variables influence the look and feel of the user interface.
 +
 
 +
=== KDE_PLASMA_COMPONENTS_PLATFORM ===
 +
Defines what platform is assumed to look for QML components, default is "desktop", at the moment the other supported is "touch". It is possible to influence the behavior of standard QML based widgets on different devices by either setting this variable or writing in the kdeclarativerc config file.
 +
 
 +
=== PLASMA_CUSTOM_PREFIX_PATHS ===
 +
Defines what fallback chain of paths to use to resolve relative paths in Plasma packages. a common usage is:
 +
 
 +
PLASMA_CUSTOM_PREFIX_PATHS=platformcontents/application/generic/:platformcontents/application/tablet/:contents/
 +
 
 +
To say that the plasma widget must behave as a full application targeted to tablet devices.
 +
 
  
 
== freedesktop.org Compliance ==
 
== freedesktop.org Compliance ==
  
The following environment variables are defined in the [http://freedesktop.org/wiki/Standards/basedir-spec freedesktop.org base directory specification] and are supported by all XDG compliant environments and applications.
+
The following environment variables are defined in the [http://freedesktop.org/wiki/Standards/basedir-spec freedesktop.org base directory specification] and are supported by all XDG-compliant environments and applications, such as KDE.
  
 
=== XDG_DATA_HOME ===
 
=== XDG_DATA_HOME ===
Defines the base directory relative to which user specific data files should be stored. If <tt>$XDG_DATA_HOME</tt> is either not set or empty, a default equal to {{path|$HOME/.local/share is used}}.
+
Defines the base directory relative to which user specific data files should be stored. If <tt>$XDG_DATA_HOME</tt> is either not set or empty, a default equal to {{path|$HOME/.local/share}} is used.
 
   
 
   
 
=== XDG_CONFIG_HOME ===
 
=== XDG_CONFIG_HOME ===
Line 101: Line 137:
 
   
 
   
 
=== XDG_DATA_DIRS ===
 
=== XDG_DATA_DIRS ===
Defines the preference-ordered set of base directories to search for data files in addition to the <tt>$XDG_DATA_HOME</tt> base directory. The directories in <tt>$XDG_DATA_DIRS</tt> should be separated with a colon ':'. If $XDG_DATA_DIRS is either not set or empty, a value equal to {{path|/usr/local/share/:/usr/share/}} is used.
+
Defines the preference-ordered set of base directories to search for data files in addition to the <tt>$XDG_DATA_HOME</tt> base directory. The directories in <tt>$XDG_DATA_DIRS</tt> should be separated with a colon ':'. If <tt>$XDG_DATA_DIRS</tt> is either not set or empty, a value equal to {{path|/usr/local/share/:/usr/share/}} is used.
 
   
 
   
 
=== XDG_CONFIG_DIRS ===
 
=== XDG_CONFIG_DIRS ===
Defines the preference-ordered set of base directories to search for configuration files in addition to the <tt>$XDG_CONFIG_HOME</tt> base directory. The directories in <tt>$XDG_CONFIG_DIRS</tt> should be separated with a colon ':'. If $XDG_CONFIG_DIRS is either not set or empty, a value equal to {{path|/etc/xdg}} is used.
+
Defines the preference-ordered set of base directories to search for configuration files in addition to the <tt>$XDG_CONFIG_HOME</tt> base directory. The directories in <tt>$XDG_CONFIG_DIRS</tt> should be separated with a colon ':'. If <tt>$XDG_CONFIG_DIRS</tt> is either not set or empty, a value equal to {{path|/etc/xdg}} is used.

Latest revision as of 17:28, 22 March 2013

Contents

[edit] Introduction

There are numerous environment variables that are useful when managing and controlling a KDE environment. Supported environment variables are listed below.

[edit] Automatically Set Variables

[edit] KDE_FULL_SESSION

Set to true by KDE startup, it is used by some programs, such as Konqueror, to know if they should consider remaining in memory for future re-use when being closed. If not set, those programs will exit after being closed (e.g. kdesu does that, it's also useful for debugging).

If you plan on using this variable to detect a running KDE session, check if the value is not empty instead of seeing if it equals true. The value might be changed in the future to include KDE version information.

[edit] KDE_SESSION_VERSION

Introduced in KDE4, this environment variable is set to the major version number of the KDE desktop being run on startup. This allows one to know which kde?-config to run: kde${KDE_SESSION_VERSION}-config. For KDE3 this will resolve to kde-config and for KDE4 this will result in kde4-config. One can then use this knowledge to query more details, such as the minor version, prefixes, etc.

[edit] Display and Window Management

[edit] KDEWM

If the KDEWM environment variable has been set, then its value will be used instead of kwin as KDE's window manager within the startkde script.

[edit] KDE_DISPLAY

An old(?) way to set DISPLAY for multihead.

[edit] KDE_MULTIHEAD

Set this variable to true to indicate that KDE is running on a multi-head system.


[edit] File System

[edit] KDEDIRS

Overrides KDEDIR and allows you to specify multiple directories where KDE searches for its data. Useful if you want or have to install some programs to a different prefix than the rest of your KDE.

Please note that at least the startkde script expects the KDE install directory to be listed first.

[edit] KDEHOME

If not set, KDE uses ~/.kde as directory where your personal data is stored.

[edit] KDE_HOME_READONLY

Set this variable to indicate that your home directory is mounted read-only.

[edit] KDEROOTHOME

If not set, KDE uses ~root/.kde for root's personal data. This was introduced to prevent KDE from accidentally overwriting user data with root permissions when a user runs a KDE program after switching to root with "su".

[edit] KDESYCOCA

Allows you to specify the path and the name of the generated KDE configuration cache file.

[edit] KDETMP

Allows you to specify a path other than /tmp for KDE to store its temporary files.

[edit] KDEVARTMP

Allows you to specify a path other than /var/tmp for KDE to store its variable files.

[edit] Localization

[edit] KDE_LANG

Allows you to override the KDE language configuration. For example, "KDE_LANG=fr kprogram &" starts a program in French if the necessary files are installed.

[edit] KDE_UTF8_FILENAMES

If this environment variable is set, KDE assumes all filenames are in UTF-8 encoding, regardless of the current C locale.

[edit] Networking

[edit] KDE_NO_IPV6

Set this variable to disable IPv6 support / IPv6 DNS lookups.

[edit] KDE_USE_IDN

The content of this variable defines for which top level domains the usage of IDN is enabled. If not set, "at:ch:cn:de:dk:kr:jp:li:no:se:tw" will be used.

[edit] Performance Related

[edit] KDE_IS_PRELINKED

Set this variable to indicate that you have prelinked your KDE binaries and libraries.

[edit] KDE_MALLOC

If set to "1" the fast malloc routine provided in kdecore is used if KDE was compiled with --enable-fast-malloc, otherwise the libc's routine is used.

[edit] KDE_NOUNLOAD

If this variable is set, then KLibLoader is told to never unload dynamically opened libraries.

[edit] KDE_DOUNLOAD

If this variable is set, then KLibLoader is told to always try to unload dynamically opened libraries. Warning, this will most probably lead to crashes!

[edit] Troubleshooting and Debugging

[edit] KDE_DEBUG

Setting this variable disables KDE's crash handler DrKonqi and instead lets the application create a core dump. This allows post mortem debugging. An alternative to KDE_DEBUG is launching the application with the command line option --nocrashhandler. Setting ulimit -c 0 will also prevent core dumps.

[edit] KDE_DEBUG_NOPROCESSINFO

Normally the current program name will be shown on every line of KDebug output. Setting this variable hides it.

[edit] KDE_DEBUG_NOAREANAME

Normally the current KDebug area will be shown on every line of KDebug output. Setting this variable hides it.

[edit] KDE_DEBUG_NOMETHODNAME

Normally the current method name will be shown on every line of KDebug output. Setting this variable hides it.

[edit] KDE_DEBUG_FILELINE

Setting this variable adds the source file and line number to every line of KDebug output. Since kdelibs-4.6.

The source file is shown relative to the top of the project directory, provided that add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS}) is used in the application's CMakeLists.txt

[edit] KDE_DEBUG_TIMESTAMP

Setting this variable to "1" adds a HH:MM:SS timestamp to every line of KDebug output. Setting the variable to "2" adds millisecond accuracy to the timestamp.

[edit] KDE_COLOR_DEBUG

Starting with KDE 4, setting this variable will get you colorful debug output.

[edit] KDE_COLOR_DEBUG_ALWAYS

KDE_COLOR_DEBUG does not provide coloured debug messages for processes spawned by the main process. With this all debug messages will be coloured.

[edit] KDE_FORK_SLAVES

Set this variable to spawn KIO-slaves directly from the application process itself. (By default, KIO-slaves are spawned using klauncher/kdeinit.) This option is useful if the KIO-slave should run in the same environment as the application; this can be the case with Clearcase.

[edit] Look and feel

The following environment variables influence the look and feel of the user interface.

[edit] KDE_PLASMA_COMPONENTS_PLATFORM

Defines what platform is assumed to look for QML components, default is "desktop", at the moment the other supported is "touch". It is possible to influence the behavior of standard QML based widgets on different devices by either setting this variable or writing in the kdeclarativerc config file.

[edit] PLASMA_CUSTOM_PREFIX_PATHS

Defines what fallback chain of paths to use to resolve relative paths in Plasma packages. a common usage is:

PLASMA_CUSTOM_PREFIX_PATHS=platformcontents/application/generic/:platformcontents/application/tablet/:contents/

To say that the plasma widget must behave as a full application targeted to tablet devices.


[edit] freedesktop.org Compliance

The following environment variables are defined in the freedesktop.org base directory specification and are supported by all XDG-compliant environments and applications, such as KDE.

[edit] XDG_DATA_HOME

Defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share is used.

[edit] XDG_CONFIG_HOME

Defines the base directory relative to which user specific configuration files should be stored. If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config is used.

[edit] XDG_DATA_DIRS

Defines the preference-ordered set of base directories to search for data files in addition to the $XDG_DATA_HOME base directory. The directories in $XDG_DATA_DIRS should be separated with a colon ':'. If $XDG_DATA_DIRS is either not set or empty, a value equal to /usr/local/share/:/usr/share/ is used.

[edit] XDG_CONFIG_DIRS

Defines the preference-ordered set of base directories to search for configuration files in addition to the $XDG_CONFIG_HOME base directory. The directories in $XDG_CONFIG_DIRS should be separated with a colon ':'. If $XDG_CONFIG_DIRS is either not set or empty, a value equal to /etc/xdg is used.


This page was last modified on 22 March 2013, at 17:28. This page has been accessed 40,001 times. Content is available under Creative Commons License SA 3.0 as well as the GNU Free Documentation License 1.2.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V.Legal