From 0dab904a54d99dc244c68a2114158cb1b354940c Mon Sep 17 00:00:00 2001 From: Philip Kristoffersen Date: Tue, 17 May 2022 17:23:57 +0200 Subject: [PATCH] Find flatpak steam location (#136) --- src/steam/utils.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/steam/utils.rs b/src/steam/utils.rs index 1298494..0fd70d7 100644 --- a/src/steam/utils.rs +++ b/src/steam/utils.rs @@ -128,13 +128,14 @@ pub fn get_default_location() -> Result> { #[cfg(target_os = "linux")] let path_string = { let home = std::env::var("HOME")?; - String::from( - Path::new(&home) + let default_path = Path::new(&home) .join(".steam") - .join("steam") - .to_str() - .unwrap_or(""), - ) + .join("steam"); + if default_path.exists(){ + default_path.to_string_lossy().to_string() + }else{ + Path::new(&home).join(".var").join("app").join("com.valvesoftware.Steam").join(".steam").join("steam").to_string_lossy().to_string() + } }; #[cfg(target_os = "macos")] let path_string = {