Skip to content

Commit

Permalink
#429: Check XDG directories in Flatpak version of Lutris
Browse files Browse the repository at this point in the history
  • Loading branch information
mtkennerly committed Dec 21, 2024
1 parent b42bbbd commit d1158be
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unreleased

* Added:
* On Linux, for Lutris roots that point to a Flatpak installation,
Ludusavi now checks `$XDG_DATA_HOME` and `$XDG_CONFIG_HOME`
inside of the Flatpak installation of Lutris.
* Changed:
* When the game list is filtered,
the summary line (e.g., "1 of 10 games") now reflects the filtered totals.
Expand Down
17 changes: 16 additions & 1 deletion src/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,22 @@ pub fn parse_paths(
.replace(p::OS_USER_NAME, &crate::prelude::OS_USERNAME));
}
}
Store::Lutris => {
if Os::HOST == Os::Linux && root_interpreted.ends_with(".var/app/net.lutris.Lutris/config/lutris") {
// Lutris is installed via Flatpak.
add_path!(path
.replace(
p::XDG_DATA,
check_nonwindows_path(&format!("{}/../../data", &root_interpreted)),
)
.replace(
p::XDG_CONFIG,
check_nonwindows_path(&format!("{}/../../config", &root_interpreted)),
)
.replace(p::STORE_USER_ID, "*")
.replace(p::OS_USER_NAME, &crate::prelude::OS_USERNAME));
}
}
Store::Steam => {
if let Some(steam_shortcut) = steam_shortcut {
if let Some(start_dir) = &steam_shortcut.start_dir {
Expand Down Expand Up @@ -382,7 +398,6 @@ pub fn parse_paths(
| Store::Epic
| Store::GogGalaxy
| Store::Legendary
| Store::Lutris
| Store::Microsoft
| Store::Origin
| Store::Prime
Expand Down

0 comments on commit d1158be

Please sign in to comment.