Skip to content

Commit ba375e1

Browse files
committed
[PHAROS] Use svg for Tools dir icon
1 parent 6b7bb24 commit ba375e1

3 files changed

Lines changed: 68 additions & 15 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version = "1.1.8"
1+
version = "1.1.9"

buildtools/pharos/app/daemon.py

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,8 @@ def notify(cfw: str, message: str) -> bool:
211211
MODULES_DIR = Path("/storage/.config/modules")
212212
MODULE_SCRIPT = MODULES_DIR / "Start Pharos.sh"
213213
MODULE_GAMELIST = MODULES_DIR / "gamelist.xml"
214-
MODULE_IMAGE = MODULES_DIR / "images" / "pharos.png"
215-
MODULE_COVER_SOURCE = INSTALL_DIR / "cover.png"
214+
MODULE_IMAGE = MODULES_DIR / "images" / "pharos.svg"
215+
MODULE_ICON_SOURCE = INSTALL_DIR / "pharos.svg"
216216
_MODULE_SCRIPT_TEMPLATE = """#!/bin/bash
217217
# Created by pharos-daemon: launches Pharos from the Tools menu.
218218
source /etc/profile
@@ -226,7 +226,7 @@ def notify(cfw: str, message: str) -> bool:
226226
exit 1
227227
"""
228228

229-
_GAMELIST_ENTRY_TEMPLATE = """ <game>
229+
_GAMELIST_ENTRY = """ <game>
230230
<path>./Start Pharos.sh</path>
231231
<name>Pharos</name>
232232
<desc>Pharos is a tool for downloading ports and wine bottles hosted on independent GitHub repositories.</desc>
@@ -236,7 +236,8 @@ def notify(cfw: str, message: str) -> bool:
236236
<releasedate>2025</releasedate>
237237
<genre>Tool</genre>
238238
<players>1</players>
239-
{image_line} </game>
239+
<image>./images/pharos.svg</image>
240+
</game>
240241
"""
241242

242243

@@ -254,23 +255,17 @@ def ensure_es_module() -> None:
254255
MODULE_SCRIPT.chmod(0o755)
255256
log("INFO", f"installed ES module {MODULE_SCRIPT}")
256257

257-
if not MODULE_IMAGE.exists() and MODULE_COVER_SOURCE.exists():
258+
if not MODULE_IMAGE.exists() and MODULE_ICON_SOURCE.exists():
258259
MODULE_IMAGE.parent.mkdir(parents=True, exist_ok=True)
259-
shutil.copyfile(MODULE_COVER_SOURCE, MODULE_IMAGE)
260-
log("INFO", f"copied module image -> {MODULE_IMAGE}")
260+
shutil.copyfile(MODULE_ICON_SOURCE, MODULE_IMAGE)
261+
log("INFO", f"copied module icon -> {MODULE_IMAGE}")
261262

262263
if MODULE_GAMELIST.exists():
263264
xml = MODULE_GAMELIST.read_text("utf-8")
264265
else:
265266
xml = '<?xml version="1.0"?>\n<gameList>\n</gameList>\n'
266267
if "Start Pharos.sh" not in xml and "</gameList>" in xml:
267-
image_line = (
268-
" <image>./images/pharos.png</image>\n"
269-
if MODULE_IMAGE.exists()
270-
else ""
271-
)
272-
entry = _GAMELIST_ENTRY_TEMPLATE.format(image_line=image_line)
273-
xml = xml.replace("</gameList>", entry + "</gameList>", 1)
268+
xml = xml.replace("</gameList>", _GAMELIST_ENTRY + "</gameList>", 1)
274269
tmp = MODULE_GAMELIST.with_suffix(".tmp")
275270
tmp.write_text(xml, encoding="utf-8")
276271
os.replace(tmp, MODULE_GAMELIST)

0 commit comments

Comments
 (0)