diff --git a/meson.build b/meson.build index c4924c7afb..6c776d3748 100644 --- a/meson.build +++ b/meson.build @@ -98,3 +98,7 @@ endif # Handle default script/config stuff meson.add_install_script('default_scripts_install.sh') + +devenv = environment() +devenv.set('GAMESCOPE_SCRIPT_PATH', join_paths(meson.current_source_dir(), 'scripts')) +meson.add_devenv(devenv) diff --git a/src/Script/Script.cpp b/src/Script/Script.cpp index a104ee993b..fe4a4c08ee 100644 --- a/src/Script/Script.cpp +++ b/src/Script/Script.cpp @@ -124,6 +124,16 @@ namespace gamescope void CScriptManager::RunDefaultScripts() { + const char *sScriptPathEnv = getenv("GAMESCOPE_SCRIPT_PATH"); + if ( sScriptPathEnv ) + { + std::vector sScriptPaths = gamescope::Split( sScriptPathEnv, ":" ); + for ( const auto &sScriptPath : sScriptPaths ) + { + RunFolder( sScriptPath, true ); + } + } + if ( cv_script_use_local_scripts ) { RunFolder( "../scripts", true );