File Fix-autostart.patch of Package discord-wbundled-electron
Give actual path to the autostart .desktop file. otherwise it gets the path to the system electron runtime.
--- a/resources/app/app_bootstrap/autoStart/linux.js 2022-03-10 17:31:00.461334289 +0100
+++ b/resources/app/app_bootstrap/autoStart/linux.js 2022-03-10 17:38:30.450210171 +0100
@@ -18,29 +18,19 @@
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-// TODO: We should use Constant's APP_NAME, but only once
-// we set up backwards compat with this.
-const appName = _path.default.basename(process.execPath, '.exe');
-
-const exePath = _electron.app.getPath('exe');
-
-const exeDir = _path.default.dirname(exePath);
-
-const iconPath = _path.default.join(exeDir, 'discord.png');
-
const autostartDir = _path.default.join(_electron.app.getPath('appData'), 'autostart');
const electronAppName = _electron.app.name ? _electron.app.name : _electron.app.getName();
-const autostartFileName = _path.default.join(autostartDir, electronAppName + '-' + _buildInfo.default.releaseChannel + '.desktop');
+const autostartFileName = _path.default.join(autostartDir, 'XXXPKGNAMEXXX.desktop');
const desktopFile = `[Desktop Entry]
Type=Application
-Exec=${exePath}
+Exec=XXXPKGNAMEXXX
Hidden=false
NoDisplay=false
-Name=${appName}
-Icon=${iconPath}
+Name=${electronAppName}
+Icon=XXXPKGNAMEXXX
Comment=Text and voice chat for gamers.
X-GNOME-Autostart-enabled=true
`;