From bf3e8a0b8a66adcbba10f369b707e606ab26c068 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 26 Nov 2024 14:47:35 +0100 Subject: [PATCH 1/6] fix(opener): Try `/usr/bin/xdg-open` first --- plugins/opener/src/open.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/opener/src/open.rs b/plugins/opener/src/open.rs index bbd836e37..fe721f9c1 100644 --- a/plugins/opener/src/open.rs +++ b/plugins/opener/src/open.rs @@ -9,7 +9,14 @@ use std::{ffi::OsStr, path::Path}; pub(crate) fn open, S: AsRef>(path: P, with: Option) -> crate::Result<()> { match with { Some(program) => ::open::with_detached(path, program.as_ref()), - None => ::open::that_detached(path), + None => { + // ref https://github.com/tauri-apps/tauri/issues/10617 + #[cfg(target_os = "linux")] + return ::open::with_detached(&path, "/usr/bin/xdg-open") + .or_else(|_| ::open::that_detached(path)); + #[cfg(not(target_os = "linux"))] + ::open::that_detached(path) + } } .map_err(Into::into) } From 0f310e75ed20b6dd37e24701501a4ea8a9c0efef Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 26 Nov 2024 14:57:41 +0100 Subject: [PATCH 2/6] fix --- plugins/opener/src/open.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/opener/src/open.rs b/plugins/opener/src/open.rs index fe721f9c1..2a1321a5e 100644 --- a/plugins/opener/src/open.rs +++ b/plugins/opener/src/open.rs @@ -9,14 +9,14 @@ use std::{ffi::OsStr, path::Path}; pub(crate) fn open, S: AsRef>(path: P, with: Option) -> crate::Result<()> { match with { Some(program) => ::open::with_detached(path, program.as_ref()), + #[cfg(target_os = "linux")] None => { // ref https://github.com/tauri-apps/tauri/issues/10617 - #[cfg(target_os = "linux")] - return ::open::with_detached(&path, "/usr/bin/xdg-open") - .or_else(|_| ::open::that_detached(path)); - #[cfg(not(target_os = "linux"))] - ::open::that_detached(path) + ::open::with_detached(&path, "/usr/bin/xdg-open") + .or_else(|_| ::open::that_detached(path)) } + #[cfg(not(target_os = "linux"))] + None => ::open::that_detached(path), } .map_err(Into::into) } From 2c00f7ddad5f05ddf69b69f619cee99836e36391 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 26 Nov 2024 15:04:53 +0100 Subject: [PATCH 3/6] shell --- .changes/shell-xdgopen.md | 5 +++++ plugins/shell/src/scope.rs | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 .changes/shell-xdgopen.md diff --git a/.changes/shell-xdgopen.md b/.changes/shell-xdgopen.md new file mode 100644 index 000000000..ddd0fc673 --- /dev/null +++ b/.changes/shell-xdgopen.md @@ -0,0 +1,5 @@ +--- +shell: patch +--- + +shell.open will now try to execute `/usr/bin/xdg-open` before using `xdg-open` from `PATH`. diff --git a/plugins/shell/src/scope.rs b/plugins/shell/src/scope.rs index 9e76931aa..2f820b58d 100644 --- a/plugins/shell/src/scope.rs +++ b/plugins/shell/src/scope.rs @@ -218,6 +218,13 @@ impl OpenScope { // the `open` dependency. This behavior should be re-confirmed during upgrades of `open`. match with.map(Program::name) { Some(program) => ::open::with_detached(path, program), + #[cfg(target_os = "linux")] + None => { + // ref https://github.com/tauri-apps/tauri/issues/10617 + ::open::with_detached(&path, "/usr/bin/xdg-open") + .or_else(|_| ::open::that_detached(path)) + } + #[cfg(not(target_os = "linux"))] None => ::open::that_detached(path), } .map_err(Into::into) From 7d9dfaeb9e71027728a37c8594171a54327f86d5 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 26 Nov 2024 15:40:14 +0100 Subject: [PATCH 4/6] lint --- plugins/shell/src/scope.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/shell/src/scope.rs b/plugins/shell/src/scope.rs index 2f820b58d..bcf7679f0 100644 --- a/plugins/shell/src/scope.rs +++ b/plugins/shell/src/scope.rs @@ -221,7 +221,7 @@ impl OpenScope { #[cfg(target_os = "linux")] None => { // ref https://github.com/tauri-apps/tauri/issues/10617 - ::open::with_detached(&path, "/usr/bin/xdg-open") + ::open::with_detached(path, "/usr/bin/xdg-open") .or_else(|_| ::open::that_detached(path)) } #[cfg(not(target_os = "linux"))] From f71be86d476ba6ae8febd849a35cb3f4d26a6f2b Mon Sep 17 00:00:00 2001 From: fabianlars Date: Mon, 2 Dec 2024 22:28:41 +0100 Subject: [PATCH 5/6] temp --- .github/workflows/covector-status.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/covector-status.yml b/.github/workflows/covector-status.yml index 7eeda427b..b2389d69d 100644 --- a/.github/workflows/covector-status.yml +++ b/.github/workflows/covector-status.yml @@ -13,10 +13,13 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # required for use of git history - - name: covector status - uses: jbolda/covector/packages/action@covector-v0 - id: covector + + - uses: actions/setup-node@v4 with: - command: 'status' - token: ${{ secrets.GITHUB_TOKEN }} - comment: true + node-version: lts/* + registry-url: 'https://registry.npmjs.org' + - name: temp + env: + NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} + run: | + npm unpublish @tauri-apps/plugin-fs@2.0.3 From 0fd529ae2264afc77eb448336c78289e5560770e Mon Sep 17 00:00:00 2001 From: fabianlars Date: Mon, 2 Dec 2024 22:31:52 +0100 Subject: [PATCH 6/6] revert --- .github/workflows/covector-status.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/covector-status.yml b/.github/workflows/covector-status.yml index b2389d69d..7eeda427b 100644 --- a/.github/workflows/covector-status.yml +++ b/.github/workflows/covector-status.yml @@ -13,13 +13,10 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # required for use of git history - - - uses: actions/setup-node@v4 + - name: covector status + uses: jbolda/covector/packages/action@covector-v0 + id: covector with: - node-version: lts/* - registry-url: 'https://registry.npmjs.org' - - name: temp - env: - NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} - run: | - npm unpublish @tauri-apps/plugin-fs@2.0.3 + command: 'status' + token: ${{ secrets.GITHUB_TOKEN }} + comment: true