Skip to content
This repository was archived by the owner on Jan 10, 2026. It is now read-only.

Commit a2434e8

Browse files
authored
Merge pull request #22 from ImSapphire/fix/steam-search-locations
fix: look for steamapps in multiple locations
2 parents ad988f8 + a41bea1 commit a2434e8

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

libsteamium/src/lib.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,21 @@ pub struct Steamium {
77
}
88

99
fn get_steam_root() -> anyhow::Result<PathBuf> {
10-
let mut steam_path = PathBuf::from(std::env::var("HOME")?);
11-
steam_path.push(".steam/steam");
12-
if !steam_path.exists() {
13-
anyhow::bail!("Steam path {:?} doesn't exist", steam_path);
14-
}
10+
let home = PathBuf::from(std::env::var("HOME")?);
11+
12+
let steam_paths: [&str; 3] = [
13+
".steam/steam",
14+
".steam/debian-installation",
15+
".var/app/com.valvesoftware.Steam/data/Steam",
16+
];
17+
let Some(steam_path) = steam_paths
18+
.iter()
19+
.map(|path| home.join(path))
20+
.filter(|p| p.exists())
21+
.next() else {
22+
anyhow::bail!("Couldn't find Steam installation in search paths");
23+
};
24+
1525
Ok(steam_path)
1626
}
1727

0 commit comments

Comments
 (0)