Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

Commit

Permalink
Added support for alternate Legendary binary
Browse files Browse the repository at this point in the history
Checks for path to an alternative legendary binary if given in Heroic
  • Loading branch information
redromnon committed Feb 26, 2022
1 parent 335446e commit 36ee2be
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions func/appimage_binary.py
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


0 comments on commit 36ee2be

Please sign in to comment.