kitowall 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/workshop.js +48 -2
- package/package.json +1 -1
package/dist/core/workshop.js
CHANGED
|
@@ -72,6 +72,48 @@ function resolveOnPath(binary) {
|
|
|
72
72
|
}
|
|
73
73
|
return undefined;
|
|
74
74
|
}
|
|
75
|
+
function buildSceneEngineEnv(enginePath) {
|
|
76
|
+
const env = { ...process.env };
|
|
77
|
+
const libPaths = [];
|
|
78
|
+
const seen = new Set();
|
|
79
|
+
const pushLibPath = (candidate) => {
|
|
80
|
+
const value = clean(candidate);
|
|
81
|
+
if (!value || seen.has(value))
|
|
82
|
+
return;
|
|
83
|
+
seen.add(value);
|
|
84
|
+
libPaths.push(value);
|
|
85
|
+
};
|
|
86
|
+
const current = clean(process.env.LD_LIBRARY_PATH);
|
|
87
|
+
if (current) {
|
|
88
|
+
for (const segment of current.split(':')) {
|
|
89
|
+
const v = clean(segment);
|
|
90
|
+
if (v)
|
|
91
|
+
pushLibPath(v);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const resolvedEngine = clean(enginePath);
|
|
95
|
+
if (resolvedEngine) {
|
|
96
|
+
const engineDir = node_path_1.default.dirname(resolvedEngine);
|
|
97
|
+
if (node_fs_1.default.existsSync(node_path_1.default.join(engineDir, 'libcef.so'))) {
|
|
98
|
+
pushLibPath(engineDir);
|
|
99
|
+
}
|
|
100
|
+
const siblingLib = node_path_1.default.join(engineDir, 'lib');
|
|
101
|
+
if (node_fs_1.default.existsSync(siblingLib) && node_fs_1.default.statSync(siblingLib).isDirectory()) {
|
|
102
|
+
pushLibPath(siblingLib);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
// Arch linux-wallpaperengine installs runtime libs here when bypassing the wrapper.
|
|
106
|
+
if (node_fs_1.default.existsSync('/opt/linux-wallpaperengine/libcef.so')) {
|
|
107
|
+
pushLibPath('/opt/linux-wallpaperengine');
|
|
108
|
+
}
|
|
109
|
+
if (node_fs_1.default.existsSync('/opt/linux-wallpaperengine/lib') && node_fs_1.default.statSync('/opt/linux-wallpaperengine/lib').isDirectory()) {
|
|
110
|
+
pushLibPath('/opt/linux-wallpaperengine/lib');
|
|
111
|
+
}
|
|
112
|
+
if (libPaths.length > 0) {
|
|
113
|
+
env.LD_LIBRARY_PATH = libPaths.join(':');
|
|
114
|
+
}
|
|
115
|
+
return env;
|
|
116
|
+
}
|
|
75
117
|
function getWePaths() {
|
|
76
118
|
const root = node_path_1.default.join(node_os_1.default.homedir(), '.local', 'share', 'kitsune', 'we');
|
|
77
119
|
return {
|
|
@@ -577,7 +619,11 @@ function workshopSceneEngineStatus() {
|
|
|
577
619
|
const resolved = resolveOnPath(cmd);
|
|
578
620
|
if (!resolved)
|
|
579
621
|
continue;
|
|
580
|
-
const verOut = (0, node_child_process_1.spawnSync)(resolved, ['--version'], {
|
|
622
|
+
const verOut = (0, node_child_process_1.spawnSync)(resolved, ['--version'], {
|
|
623
|
+
encoding: 'utf8',
|
|
624
|
+
timeout: 2500,
|
|
625
|
+
env: buildSceneEngineEnv(resolved)
|
|
626
|
+
});
|
|
581
627
|
const stdout = clean(verOut.stdout) ?? '';
|
|
582
628
|
const stderr = clean(verOut.stderr) ?? '';
|
|
583
629
|
const version = (stdout.split('\n')[0] || stderr.split('\n')[0] || '').trim();
|
|
@@ -1298,7 +1344,7 @@ function spawnSceneEngine(monitor, wallpaperDir) {
|
|
|
1298
1344
|
const child = (0, node_child_process_1.spawn)(enginePath, ['--screen-root', monitor, '--bg', wallpaperDir], {
|
|
1299
1345
|
detached: true,
|
|
1300
1346
|
stdio: 'ignore',
|
|
1301
|
-
env:
|
|
1347
|
+
env: buildSceneEngineEnv(enginePath)
|
|
1302
1348
|
});
|
|
1303
1349
|
let settled = false;
|
|
1304
1350
|
const done = (fn) => {
|