0.8
Environment Variables

This chapter discusses several environment variables that can be used to configure the EGT library at runtime.

EGT will look at several runtime environment variables to change the operation of the library. For example, you can change some configurations and set log levels using environment variables.

There are many ways to set an environment variable for a process, but generally speaking you can run a process in a shell and specify some environment variables:

EGT_DEBUG=1 EGT_KMS_BUFFERS=1 ./egt_space
EGT_DEBUG

Set the numeric log level for the framework. If the library is compiled with debug turned off, the internal DEBUG and TRACE log levels are removed at compile time.

  • TRACE = 0
  • DEBUG = 1
  • INFO = 2
  • WARN = 3
  • ERROR = 4
  • CRITICAL = 5
  • OFF = 6

See Configure Options for more information on compile time options.

EGT_BACKEND

Select what backend to use for rendering to the screen. If this environment variable is not specified, a suitable default will be chosen.

  • kms
  • x11
  • sdl2
  • fbdev

EGT_KMS_BUFFERS

Specify the number of buffers to use for KMS. If you specify a single buffer, no buffering will be used. If you specify 2 buffers, double buffering will be used. If you specify 3 buffers, triple buffering will be used, and so on.

EGT_INPUT_DEVICES

Configure mapping of input devices to their EGT input backend.

Available backends include:

  • tslib
  • libinput

Example

EGT_INPUT_DEVICES=libinput:/dev/input/touchscreen0,/dev/input/touchscreen1;tslib:/dev/input/touchscreen2

EGT_ICONS_DIRECTORY

Change EGT installed default icons directory with a absolute path or directory name. If a directory name is set, then this directory name will be appended with an EGT installed default icons directory path. examples: /home/egt/icons, 64px, /usr/share/libegt/icons/128px.

Example

EGT_ICONS_DIRECTORY=/usr/share/icons

or

EGT_ICONS_DIRECTORY=64px

EGT_SCREEN_SIZE

Set a custom screen size. This is only possible with some backends, like X11.

Example

EGT_SCREEN_SIZE=640x480 ./widgets

EGT_SEARCH_PATH

Add additional search directories to find resources.

Example

EGT_SEARCH_PATH=/opt/icons:/usr/share/planes

EGT_SCREEN_ASYNC_FLIP

A non-empty value tells the screen backend to perform asynchronous flip operations. Note that when this is enabled, screen tearing may be possible.

Example

EGT_SCREEN_ASYNC_FLIP=1 ./widgets

EGT_X11_NODECORATION

A non-empty valye turns off window decorations on an X11 window.