feat: generate shortcuts

This commit is contained in:
aclist committed 2026-07-11 15:33:52 +09:00
1 parent b50d061e1f
commit caf071f997
13 files changed
+380 -40

No files matched your search

+1 -1
View File
@@ -41,10 +41,10 @@ def print_mods(mods: list[int]) -> str:
def write_diagnostic(config: Path, outfile: Path) -> None:
# TODO: test availability on other distros
date = datetime.now().isoformat()
try:
# FIXME: ID_LIKE not available on CachyOS
distro = platform.freedesktop_os_release()["ID_LIKE"]
except Exception as e:
logger.warn(e)
+23
View File
@@ -0,0 +1,23 @@
import os
import shutil
from importlib import resources
from pathlib import Path
from dzgui.const.constants import APP_NAME_LOWER, IMAGES_PATH
def make_parents(path: "Path") -> None:
path.parent.mkdir(parents=True, exist_ok=True)
def copy_dzgui_to_xdg_data(exe_path: Path) -> None:
dzgui = os.getenv("PYAPP")
if dzgui is None:
return
make_parents(exe_path)
shutil.copy(dzgui, exe_path)
def find_icon_resource() -> "Path":
traversable = resources.files(APP_NAME_LOWER).joinpath(IMAGES_PATH)
images = Path(str(traversable))
icon = images.joinpath("icon.png")
return icon