Change default location for Origin

This commit is contained in:
Philip Kristoffersen
2021-10-02 07:19:04 +02:00
parent a101eb2fa3
commit 7487ddfc55
+9 -3
View File
@@ -85,8 +85,6 @@ fn is_mfst_file(file: &DirEntry) -> bool {
.unwrap_or(false) .unwrap_or(false)
} }
fn parse_id_from_file(i: &str) -> nom::IResult<&str, &str> { fn parse_id_from_file(i: &str) -> nom::IResult<&str, &str> {
let (i, _) = take_until("currentstate=kReadyToStart")(i)?; let (i, _) = take_until("currentstate=kReadyToStart")(i)?;
let (i, _) = take_until("&id=")(i)?; let (i, _) = take_until("&id=")(i)?;
@@ -96,9 +94,17 @@ fn parse_id_from_file(i: &str) -> nom::IResult<&str, &str> {
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
fn get_default_location() -> String { fn get_default_location() -> String {
//TODO implement this for linux:
// https://www.toptensoftware.com/blog/running-ea-origin-games-under-linux-via-steam-and-proton/
//If we don't have a home drive we have to just die //If we don't have a home drive we have to just die
let home = std::env::var("HOME").expect("Expected a home variable to be defined"); let home = std::env::var("HOME").expect("Expected a home variable to be defined");
format!("{}/.origin/", home) Path::new(&home)
.join("Games/origin/drive_c/ProgramData/Origin/")
.to_str()
.unwrap()
.to_string()
} }
#[cfg(target_os = "windows")] #[cfg(target_os = "windows")]