Skip to content

Commit

Permalink
Different approach
Browse files Browse the repository at this point in the history
  • Loading branch information
ikoenigsknecht committed Oct 6, 2024
1 parent 4887963 commit 43fdcb0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 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,9 +36,12 @@ export const updateDesktopFile = (isDev: boolean) => {
}

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

0 comments on commit 43fdcb0

Please sign in to comment.