feat: improve portability – fix spec entry point, add hicolor icons, force Adwaita theme on KDE
This commit is contained in:
@@ -3,12 +3,23 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
import threading
|
import threading
|
||||||
import urllib.error
|
import urllib.error
|
||||||
from dataclasses import asdict, dataclass
|
from dataclasses import asdict, dataclass
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Callable
|
from typing import Any, Callable
|
||||||
|
|
||||||
|
# When running as a frozen binary (PyInstaller) on non-GNOME desktops (e.g. KDE),
|
||||||
|
# no GTK theme is configured by default. Force Adwaita so the bundled theme is
|
||||||
|
# used and the UI renders correctly.
|
||||||
|
if getattr(sys, "frozen", False):
|
||||||
|
os.environ.setdefault("GTK_THEME", "Adwaita")
|
||||||
|
# Allow GTK4 to fall back from Wayland to X11 if the Wayland compositor
|
||||||
|
# does not support the required protocols (common on some KDE setups).
|
||||||
|
os.environ.setdefault("GDK_BACKEND", "wayland,x11")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import gi # type: ignore[import-not-found]
|
import gi # type: ignore[import-not-found]
|
||||||
except ImportError as exc:
|
except ImportError as exc:
|
||||||
|
|||||||
+2
-2
@@ -2,7 +2,7 @@
|
|||||||
"""PyInstaller spec for Cellar GTK – portable all-in-one executable."""
|
"""PyInstaller spec for Cellar GTK – portable all-in-one executable."""
|
||||||
|
|
||||||
a = Analysis(
|
a = Analysis(
|
||||||
["gtk_client.py"],
|
["cellar-gtk.py"],
|
||||||
pathex=[],
|
pathex=[],
|
||||||
binaries=[],
|
binaries=[],
|
||||||
datas=[],
|
datas=[],
|
||||||
@@ -32,7 +32,7 @@ a = Analysis(
|
|||||||
"Gdk": "4.0",
|
"Gdk": "4.0",
|
||||||
"Gsk": "4.0",
|
"Gsk": "4.0",
|
||||||
},
|
},
|
||||||
"icons": ["Adwaita"],
|
"icons": ["Adwaita", "hicolor"],
|
||||||
"themes": ["Adwaita"],
|
"themes": ["Adwaita"],
|
||||||
"languages": [],
|
"languages": [],
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user