1 diff --git a/common/SC_Filesystem_unix.cpp b/common/SC_Filesystem_unix.cpp
2 index 52dc1fd2d..aae09ed9c 100644
3 --- a/common/SC_Filesystem_unix.cpp
4 +++ b/common/SC_Filesystem_unix.cpp
5 @@ -94,6 +94,10 @@ bool SC_Filesystem::isNonHostPlatformDirectoryName(const std::string& s) {
8 Path SC_Filesystem::defaultSystemAppSupportDirectory() {
9 + const char* sc_data_dir = getenv("SC_DATA_DIR");
11 + return Path(sc_data_dir);
14 return Path(SC_DATA_DIR);
16 @@ -125,6 +129,10 @@ Path SC_Filesystem::defaultUserConfigDirectory() {
19 Path SC_Filesystem::defaultResourceDirectory() {
20 + const char* sc_data_dir = getenv("SC_DATA_DIR");
22 + return Path(sc_data_dir);
25 return Path(SC_DATA_DIR);
27 diff --git a/server/scsynth/SC_Lib_Cintf.cpp b/server/scsynth/SC_Lib_Cintf.cpp
28 index f6219307e..28e13eb98 100644
29 --- a/server/scsynth/SC_Lib_Cintf.cpp
30 +++ b/server/scsynth/SC_Lib_Cintf.cpp
31 @@ -178,9 +178,13 @@ void initialize_library(const char* uGensPluginPath) {
32 using DirName = SC_Filesystem::DirName;
34 if (loadUGensExtDirs) {
35 + const char* sc_plugin_dir = getenv("SC_PLUGIN_DIR");
36 + if (sc_plugin_dir) {
37 + PlugIn_LoadDir(sc_plugin_dir, true);
40 // load globally installed plugins
41 - if (bfs::is_directory(SC_PLUGIN_DIR)) {
42 + else if (bfs::is_directory(SC_PLUGIN_DIR)) {
43 PlugIn_LoadDir(SC_PLUGIN_DIR, true);
45 #endif // SC_PLUGIN_DIR
46 diff --git a/server/supernova/server/main.cpp b/server/supernova/server/main.cpp
47 index b2b5adf4e..6cb8c411c 100644
48 --- a/server/supernova/server/main.cpp
49 +++ b/server/supernova/server/main.cpp
50 @@ -224,8 +224,14 @@ void set_plugin_paths(server_arguments const& args, nova::sc_ugen_factory* facto
54 + const char* sc_plugin_dir = getenv("SC_PLUGIN_DIR");
55 + if (sc_plugin_dir) {
56 + factory->load_plugin_folder(sc_plugin_dir);
59 - factory->load_plugin_folder(SC_PLUGIN_DIR);
61 + factory->load_plugin_folder(SC_PLUGIN_DIR);
64 factory->load_plugin_folder(SC_Filesystem::instance().getDirectory(DirName::Resource) / SC_PLUGIN_DIR_NAME);
65 factory->load_plugin_folder(SC_Filesystem::instance().getDirectory(DirName::SystemExtension));