From 9c41d2a1913c692f17ce34c606b189eb7a66d80a Mon Sep 17 00:00:00 2001 From: Anand Hegde Date: Sun, 13 Sep 2026 07:38:49 +0000 Subject: [PATCH] fix(linux): pass deep-link URL to the app so sign-in works on cold start The bundled desktop entry advertises SqlKit as the sqlkit:// handler but never forwards the URL, so signing in on Linux silently does nothing when the app is not already running. tauri-bundler derives MimeType=x-scheme-handler/sqlkit from the deep-link config, so the desktop routes sqlkit:// links to SqlKit. Its template then emits a bare `Exec={{exec}}` with no field code, so the URL is dropped instead of being appended to argv. tauri-plugin-deep-link builds its URL list from std::env::args() at init, so get_current() returns None, the cold-start branch in lib.rs never fires, and the sqlkit://auth event that App.vue listens for is never emitted. The token, username and email from the callback are lost. Add a custom desktopTemplate with `Exec={{exec}} %u`. The plugin's own runtime-registration template already uses `%u`, so this aligns the bundled entry with what the plugin expects. StartupWMClass keeps the bare {{exec}} so window grouping still matches the binary, and Name keeps {{name}} since productName is already capitalized. Also set bundle.category, which was unset and left Categories= empty, so the app files under no menu category. DeveloperTool maps to Development; on freedesktop and public.app-category.developer-tools on macOS. Wired into deb and rpm since both are published; AppImage inherits the deb template because its bundler reuses debian::generate_data. --- src-tauri/linux/SqlKit.desktop | 14 ++++++++++++++ src-tauri/tauri.conf.json | 9 +++++++++ 2 files changed, 23 insertions(+) create mode 100644 src-tauri/linux/SqlKit.desktop diff --git a/src-tauri/linux/SqlKit.desktop b/src-tauri/linux/SqlKit.desktop new file mode 100644 index 0000000..063c11c --- /dev/null +++ b/src-tauri/linux/SqlKit.desktop @@ -0,0 +1,14 @@ +[Desktop Entry] +Categories={{categories}} +{{#if comment}} +Comment={{comment}} +{{/if}} +Exec={{exec}} %u +StartupWMClass={{exec}} +Icon={{icon}} +Name={{name}} +Terminal=false +Type=Application +{{#if mime_type}} +MimeType={{mime_type}} +{{/if}} diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 82bf951..13f93dd 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -30,6 +30,7 @@ }, "bundle": { "active": true, + "category": "DeveloperTool", "targets": "all", "createUpdaterArtifacts": true, "icon": [ @@ -39,6 +40,14 @@ "icons/icon.icns", "icons/icon.ico" ], + "linux": { + "deb": { + "desktopTemplate": "linux/SqlKit.desktop" + }, + "rpm": { + "desktopTemplate": "linux/SqlKit.desktop" + } + }, "macOS": { "minimumSystemVersion": "10.15", "exceptionDomain": "",