Skip to content

Commit 0dab904

Browse files
authored
Find flatpak steam location (#136)
1 parent faea4e0 commit 0dab904

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/steam/utils.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,14 @@ pub fn get_default_location() -> Result<String, Box<dyn Error + Sync + Send>> {
128128
#[cfg(target_os = "linux")]
129129
let path_string = {
130130
let home = std::env::var("HOME")?;
131-
String::from(
132-
Path::new(&home)
131+
let default_path = Path::new(&home)
133132
.join(".steam")
134-
.join("steam")
135-
.to_str()
136-
.unwrap_or(""),
137-
)
133+
.join("steam");
134+
if default_path.exists(){
135+
default_path.to_string_lossy().to_string()
136+
}else{
137+
Path::new(&home).join(".var").join("app").join("com.valvesoftware.Steam").join(".steam").join("steam").to_string_lossy().to_string()
138+
}
138139
};
139140
#[cfg(target_os = "macos")]
140141
let path_string = {

0 commit comments

Comments
 (0)