diff --git a/src/lib/library.js b/src/lib/library.js index 69c5106..ece3e43 100644 --- a/src/lib/library.js +++ b/src/lib/library.js @@ -183,14 +183,27 @@ export async function createDesktopFile(version, forceRecreate = false) { return; } await remove(desktopFilePath); + } + + + const settings = get(currentSettings); + const libraryDir = settings.libraryDir; + + if (!libraryDir) { + return { + success: false, + message: `couldn't find library` + }; } + const blenderConfigPath = await join(libraryDir, BASE_LIBRARY_DIR, 'config', version.version); + let bannerPath = await join(version.path, 'banner.png'); try { const desktopFileContent = `[Desktop Entry] Type=Application Name=Blender ${version.version} Comment=Blender ${version.version} - 3D creation suite -Exec=${version.executable.replace(/ /g, '\\ ')} %F +Exec=env BLENDER_USER_RESOURCES=${blenderConfigPath.replace(/ /g, '\\ ')} BLENDER_CUSTOM_SPLASH_BANNER=${bannerPath.replace(/ /g, '\\ ')} ${version.executable.replace(/ /g, '\\ ')} %F Icon=${version.path.replace(/ /g, '\\ ')}/icon.png Terminal=false Categories=Graphics;3DGraphics;