Fixed Heroic games installed via flatpak not being detected. #119

This commit is contained in:
Tickbase
2026-07-11 12:08:49 +02:00
parent 871381f3fa
commit fe80af5639
+25 -10
View File
@@ -30,17 +30,32 @@ struct InstalledEntry {
fn legendary_config_dir() -> Option<PathBuf> { fn legendary_config_dir() -> Option<PathBuf> {
let home = std::env::var("HOME").ok()?; let home = std::env::var("HOME").ok()?;
let path = PathBuf::from(&home) let home = PathBuf::from(&home);
.join(".config")
.join("heroic") // Heroic can be installed natively or via Flatpak. Flatpak sandboxes
.join("legendaryConfig") // XDG_CONFIG_HOME to ~/.var/app/<app-id>/config, so ~/.config/heroic
.join("legendary"); // never exists in that case even though the game library itself lives
if path.exists() { // on the normal host path (e.g. on Steam Deck installs via Discover).
Some(path) let candidates = [
} else { home.join(".config").join("heroic"),
warn!("Heroic legendary config dir not found at: {}", path.display()); home.join(".var")
None .join("app")
.join("com.heroicgameslauncher.hgl")
.join("config")
.join("heroic"),
];
for candidate in &candidates {
let path = candidate.join("legendaryConfig").join("legendary");
if path.exists() {
return Some(path);
}
} }
warn!(
"Heroic legendary config dir not found in any known location (checked native and Flatpak paths)"
);
None
} }
pub fn scan_epic_games() -> Vec<EpicGame> { pub fn scan_epic_games() -> Vec<EpicGame> {