1.0
Environment Variables

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

EGT will look at several run time 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 just for that process:

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:

  • libinput (default)
  • tslib
  • evdev

Use libinput and tslib to handle different touchscreens:

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

Get keyboard events for the USER button on a SOM1-EK board:

EGT_INPUT_DEVICES=evdev:/dev/input/event2

EGT_ICONS_DIRECTORY

Change EGT installed default icons directory with an absolute or relative path.

The directory path contents specified must be in the expected format as the default EGT icons directory, containing subdirectories of icon size. For example, 16px, 32px, 64px, and 128px.

Example

EGT_ICONS_DIRECTORY=/usr/share/icons

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 value turns off window decorations on an X11 window.

EGT_TIME_DRAW

Print timing information for drawing every widget.

EGT_TIME_EVENTLOOP

Print timing information for the event loop.

EGT_SHOW_FPS

Print the frames per second of the event loop.

EGT_NO_COMPOSITION_BUFFER

Instead of using a composition buffer, always render directly into the framebuffer. This only works if there is a backend with a single framebuffer. For example, when using KMS, the environment variable EGT_KMS_BUFFERS must equal 1. Otherwise it has no effect and may not apply to all backends.

EGT_USE_GFX2D

A non-empty value enables the use of the GFX2D GPU. Set this option only if the device has a 2D GPU. If cairo doesn't have the libm2d support, this option has no effect.