Skip to content

Commit

Permalink
fix: appimage auto launch, close #403
Browse files Browse the repository at this point in the history
  • Loading branch information
zzzgydi committed Feb 11, 2023
1 parent 6783355 commit 692f8c8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src-tauri/src/core/sysopt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,26 @@ impl Sysopt {
})()
.unwrap_or(app_path);

// fix #403
#[cfg(target_os = "linux")]
let app_path = {
use core::handle::Handle;
use tauri::Manager;

let handle = Handle::global();
handle
.app_handle
.lock()
.map(|app_handle| {
app_handle
.env()
.appimage
.and_then(|p| p.to_str().map(|s| s.to_string()))
})
.unwrap_or(Some(app_path))
.unwrap()
};

let auto = AutoLaunchBuilder::new()
.set_app_name(app_name)
.set_app_path(&app_path)
Expand Down

0 comments on commit 692f8c8

Please sign in to comment.