diff --git a/editor.sh b/editor.sh index 5d05857..0d032ae 100644 --- a/editor.sh +++ b/editor.sh @@ -21,6 +21,11 @@ function update_display_server_args () { fi fi + # shellcheck disable=SC2050 + if [ "@ELECTRON_ENABLED@" -eq 0 ]; then + return 0 + fi + if [ -e "$wayland_socket" ]; then DISPLAY_SERVER_ARGS=( "--ozone-platform=wayland" diff --git a/meson.build b/meson.build index 29ef743..e0de409 100644 --- a/meson.build +++ b/meson.build @@ -31,6 +31,10 @@ else sdk_version = get_option('sdk_version') endif +feature_electron = get_option('electron').enable_if( + get_option('zypak').enabled() +) + editor_args = [] foreach arg : get_option('editor_args') editor_args += '"@0@"'.format(arg) @@ -67,6 +71,7 @@ wrapper_data = configuration_data({ 'WRAPPER_PATH': wrapper_path, 'EDITOR_BINARY': editor_path, 'EDITOR_ARGS': ' '.join(editor_args), + 'ELECTRON_ENABLED': feature_electron.enabled().to_int(), 'ZYPAK_ARGS': ' '.join(zypak_args), 'EXPORT_ENVS': ' && '.join(export_envs), 'EXPORT_ENVS_INNER': ' && '.join(export_envs_inner), diff --git a/meson_options.txt b/meson_options.txt index 0095e6a..8f0a4b9 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,6 +8,7 @@ option('first_run_template', type: 'string', value: 'first_run.txt') option('sdk_update_template', type: 'string', value: 'sdk_update.txt') option('flagfile_prefix', type: 'string', value: 'flatpak-vscode') option('default_loglevel', type: 'string', value: '1') +option('electron', type: 'feature', value: 'auto') option('zypak', type: 'feature', value: 'disabled') option('zypak_args', type: 'array', value: ['host']) option('envs', type: 'array', value: [])