Pass config file from compositor to everything

Graphics / Wayland / Weston - Pekka Paalanen [collabora.co.uk] - 27 March 2015 02:38 UTC

We have the Weston command line option '--no-config' which is meant to prevent loading weston.ini at all. It works for Weston itself, but it does not work for any clients that also want to read weston.ini.

To fix that, introduce a new environment variable WESTON_CONFIG_FILE. Weston will set it to the absolute path of the config file it loads. Clients will load the config file pointed to by WESTON_CONFIG_FILE. If the environment variable is set but empty, no config file will be loaded. If the variable is unset, things fall back to the default "weston.ini".

Note, that Weston will only set WESTON_CONFIG_FILE, it never reads it. The ability to specify a custom config file to load will be another patch.

All programs that loaded "weston.ini" are modified to honour WESTON_CONFIG_FILE.

6c71aae Pass config file from compositor to everything
clients/desktop-shell.c | 4 +++-
clients/ivi-shell-user-interface.c | 4 +++-
clients/terminal.c | 4 +++-
clients/window.c | 4 +++-
man/weston.man | 9 +++++++++
shared/config-parser.c | 12 ++++++++++++
shared/config-parser.h | 5 +++++
src/compositor.c | 9 +++++++--
8 files changed, 45 insertions(+), 6 deletions(-)

Upstream: cgit.freedesktop.org


  • Share