Difference between revisions of "Environment variables"

From Inkscape Wiki
Jump to navigation Jump to search
(→‎Inkscape: use header formatting)
Line 10: Line 10:
; <code>INKSCAPE_DATADIR</code>
; <code>INKSCAPE_DATADIR</code>
: Specifies a different location for the Inkscape data directory (i.e. the system folder where Inkscape looks for shared files).
: Specifies a different location for the Inkscape data directory (i.e. the system folder where Inkscape looks for shared files).
: By default this equals to something like <tt>/share</tt> (*nix) or <tt>%ProgramFiles%/Inkscape/share</tt> (Windows).
: By default this equals to something like <tt>/usr/share/inkscape</tt> (*nix) or <tt>%ProgramFiles%/Inkscape/share</tt> (Windows).
: Make sure there's a <tt>share/inkscape</tt> folder present in this location that contains system-wide Inkscape data like extensions, filters, gradients, icons, etc.
: Make sure there's a <tt>share/inkscape</tt> folder present in this location that contains system-wide Inkscape data like extensions, filters, gradients, icons, etc.
; <code>INKSCAPE_LOCALEDIR</code>
; <code>INKSCAPE_LOCALEDIR</code>

Revision as of 20:00, 8 July 2019

This is a list of some helpful environment variables, that you can use to modify the behavior of Inkscape itself as well as of the libraries it uses.

Inkscape

Environment variables specific to Inkscape

INKSCAPE_PROFILE_DIR
Specifies a different location for the user profile directory (i.e. the folder where preferences and user data are saved).
By default this equals to something like ~/.config/inkscape (*nix) or %appdata%/inkscape (Windows)
INKSCAPE_DATADIR
Specifies a different location for the Inkscape data directory (i.e. the system folder where Inkscape looks for shared files).
By default this equals to something like /usr/share/inkscape (*nix) or %ProgramFiles%/Inkscape/share (Windows).
Make sure there's a share/inkscape folder present in this location that contains system-wide Inkscape data like extensions, filters, gradients, icons, etc.
INKSCAPE_LOCALEDIR
Specifies a different location for the folder where Inkscape looks for the translation catalog (i.e. binary inkscape.mo files).
By default this equals to something like /share/locale (*nix) or %ProgramFiles%/Inkscape/share/locale (Windows).

System-wide environment variables that directly affect Inkscape

LANG
Sets the system locale (i.e. the language used by the system) and will override Inkscape's default interface language.
For example setting something like LANG=fr_FR.UTF-8 will cause Inkscape to use French by default.

glib / gtk

Environment variables specific to Inkscape's core libraries and GUI toolkit. For a full list, see

Particularly helpful for general debugging purposes are the environment variables that control debug output, namely glib's G_MESSAGES_DEBUG and gtk's GTK_DEBUG. Setting either of those to the special value all will print a lot of additional debug output to the console. Be aware that there will be a lot of output when using all, so you might want to fine-tune the debug options to only output information of relevant program components.

To trace warnings and critical debug messages, the environment variable G_DEBUG can prove useful. Setting it's value to fatal-warnings causes glib to abort the program on all warnings, i.e. the first call to either of g_warning() and g_critical(). Setting it to fatal-criticals will only abort on calls to g_critical().

Visually debugging gtk

A very helpful way to "debug" GUI issues (like fine-tuning CSS or inspecting the individual parts of the GUI and their properties) is the GTK Inspector. It can be accessed by setting the environment variable GTK_DEBUG=interactive

Python

Environment variables specific to Python:

PYTHONPATH
Allows you to add additional directories to the list of paths Python is searching for modules to load.
Usually there's no need to adjust this variable (Inkscape adds the system-wide extensions directory as well as the extensions directory in the user profile folder automatically). However if you're writing an extension and would like to load some modules from other locations this is an way to do this. Note that Inkscape will prepend the PYTHONPATH with the default module locations, so you can't use this method to override modules shipped with Inkscape.