Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
liias committed Sep 19, 2024
1 parent 6f9f285 commit 0c41768
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extra/linux/dist/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ if [[ $* != *--skip-desktop-database* ]]; then
update-desktop-database "$TARGET_DESKTOP_DIR_PATH"

# Sets Browsers as default application for https and http mimetypes
xdg-mime default "software.Browsers.desktop" https http || echo "Could not make Browsers as default web link opener"
xdg-mime default "software.Browsers.desktop" x-scheme-handler/https x-scheme-handler/http || echo "Could not make Browsers as default web link opener"
fi

echo "Browsers has been installed. Enjoy!"
Expand Down
6 changes: 3 additions & 3 deletions src/linux/linux_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ pub fn set_default_web_browser() -> bool {
let result = Command::new("xdg-mime")
.arg("default")
.arg(desktop_file_name.as_str())
.arg("https http")
.arg("x-scheme-handler/https x-scheme-handler/http")
.status();

if result.is_err() {
Expand All @@ -455,8 +455,8 @@ pub fn set_default_web_browser() -> bool {
pub fn is_default_web_browser() -> bool {
let desktop_file_name = format!("{}.desktop", XDG_NAME);

let https_default_app = query_default_app("https").unwrap_or("".to_string());
let http_default_app = query_default_app("http").unwrap_or("".to_string());
let https_default_app = query_default_app("x-scheme-handler/https").unwrap_or("".to_string());
let http_default_app = query_default_app("x-scheme-handler/http").unwrap_or("".to_string());

return https_default_app == desktop_file_name && http_default_app == desktop_file_name;
}
Expand Down

0 comments on commit 0c41768

Please sign in to comment.