Skip to content

Commit

Permalink
Fix url scheme handler error on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
ikoenigsknecht committed Oct 7, 2024
1 parent 3c81088 commit de360da
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/desktop/src/main/invitation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ export const processInvitationCode = (mainWindow: BrowserWindow, code: string |
export const updateDesktopFile = (isDev: boolean) => {
if (isDev || process.platform !== 'linux') return

const appDesktopFile = path.join(os.homedir(), '.local/share/applications/quiet.desktop')
const resource = path.join(process.resourcesPath, 'quiet.desktop')
const desktopName = 'quiet.desktop'
const appDesktopFile = path.join(os.homedir(), `.local/share/applications/${desktopName}`)
const resource = path.join(process.resourcesPath, desktopName)

try {
if (!fs.existsSync(appDesktopFile)) {
Expand All @@ -35,7 +36,10 @@ export const updateDesktopFile = (isDev: boolean) => {
}

try {
execSync('xdg-settings set default-url-scheme-handler quiet quiet.desktop')
const scheme = 'x-scheme-handler/quiet'
logger.info(execSync(`xdg-mime query default ${scheme}`).toString())
logger.info(execSync(`xdg-mime default ${desktopName} ${scheme}`).toString())
logger.info(execSync(`xdg-mime query default ${scheme}`).toString())
} catch (e) {
logger.error("Couldn't set default scheme handler", e)
}
Expand Down

0 comments on commit de360da

Please sign in to comment.