This repository has been archived by the owner on May 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for alternate Legendary binary
Checks for path to an alternative legendary binary if given in Heroic
- Loading branch information
Showing
1 changed file
with
24 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,34 @@ | ||
#For AppImage, check if alternavtive binary (Legendary) is added. | ||
#If not, check folder under /tmp/ that includes path to the binaries. | ||
|
||
import os | ||
import os, json | ||
|
||
def getlegendaryappimage(): | ||
|
||
legendary_path = "" | ||
|
||
#Path to heroic's where each installed game's json is stored | ||
heroicconfigpath = os.path.expanduser("~") + "/.config/heroic/config.json" | ||
|
||
#Path to tmp dir | ||
list = os.listdir('/tmp/') | ||
|
||
heroic_path = "" | ||
#Convert config json to dict | ||
with open(heroicconfigpath) as p: | ||
heroicconfig = json.load(p) | ||
|
||
for i in list: | ||
if "Heroic" in i: | ||
#print(i) | ||
heroic_path = '/tmp/' + i + '/resources/app.asar.unpacked/build/bin/linux/legendary ' | ||
break | ||
#If legendary binary doesn't exist, check for temp folder | ||
if heroicconfig["defaultSettings"]["altLegendaryBin"] == "": | ||
|
||
for i in list: | ||
if "Heroic" in i: | ||
#print(i) | ||
legendary_path = '/tmp/' + i + '/resources/app.asar.unpacked/build/bin/linux/legendary ' | ||
break | ||
else: | ||
|
||
return heroic_path | ||
legendary_path = heroicconfig["defaultSettings"]["altLegendaryBin"] + " " | ||
|
||
return legendary_path | ||
|
||
|