On Linux, `update-desktop-database` (from `desktop-file-utils`) may not
be installed, especially on KDE systems. Instead of failing with an IO
error, log a warning when the command is not found and continue.
Non-NotFound errors still propagate as before.
Fixes#2265
Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* fix(deep-link): honor XDG failures and unregister associations
* test(deep-link): isolate other application handlers
* chore: satisfy release metadata and test header checks
* fix(deep-link): gate XDG helpers to Linux
The plugin only supports Linux, so FreeBSD builds warned about dead code.
* refactor(deep-link): add run_command helper
Share the spawn, status check and logging for XDG commands.
* refactor(deep-link): share desktop file list helpers
register and unregister now edit MimeType lists the same way.
* fix(deep-link): keep desktop file quoting on register
Parse raw values so a quoted Exec matches and isn't rewritten each time.
* fix(deep-link): clean mimeapps.list first on unregister
A failing update-desktop-database no longer leaves the app as the default.
* fix(deep-link): keep mimeapps.list comments on unregister
Edit it line by line instead of re-serializing it through rust-ini.
* fix(deep-link): skip cache refresh when nothing to unregister
Only run update-desktop-database if the desktop file changed or the cache still lists the app.
* fix(deep-link): treat no default handler as unregistered
xdg-mime exits with 4 on KDE and LXQt when no handler is set.
* fix(deep-link): tolerate padded xdg-mime query output
Compare the trimmed first line instead of the raw output.
* test(deep-link): run XDG tests in CI
Drop #[ignore], skip when the tools are missing, and install them on Linux CI.
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* single-instance: fix `cwd` in single instance on macOS
which was the `cwd` of the first instance, instead of the second how it should be and is on windows and linux.
also add rustfmt.toml to enforce the correct formatting (4 spaces for indent)
* use split_once
* remove rustfmt
* fix indentation
---------
Co-authored-by: Lucas Nogueira <lucas@tauri.app>
* fix(deep-link): local machine registry handling
* typo
* Wrong version bump
* return false if registry open fails
---------
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>
* feat(deep-link): implement getCurrent on Windows/Linux
checks std::env::args() on initialization, also includes integration with the single-instance plugin
* fmt
* update docs, fix event
* add register_all function
* expose api
* be nicer on docs, clippy
* Add WebviewWindow to code docs
* Shorten the WebView Name
* Apply suggestions from code review
---------
Co-authored-by: Lucas Fernandes Nogueira <lucas@tauri.app>