Difference between revisions of "Environment variables"
(Add section on glib / gtk) |
(Section for Python (PYTHONPATH)) |
||
Line 40: | Line 40: | ||
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 [https://blog.gtk.org/2017/04/05/the-gtk-inspector/ GTK Inspector]. It can be accessed by setting the environment variable <code>GTK_DEBUG=interactive</code> | 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 [https://blog.gtk.org/2017/04/05/the-gtk-inspector/ GTK Inspector]. It can be accessed by setting the environment variable <code>GTK_DEBUG=interactive</code> | ||
== Python == | |||
Environment variables specific to Python: | |||
; <code>PYTHONPATH</code> | |||
: 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 <code>PYTHONPATH</code> with the default module locations, so you can't use this method to override modules shipped with Inkscape. |
Revision as of 19:01, 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 /share (*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).
glib / gtk
Environment variables specific to Inkscape's core libraries and GUI toolkit. For a full list, see
- Running GLib Applications and
- Running GTK+ Applications respectively
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.