Skip to content

Commit e092fb5

Browse files
fix(aur): use XDG_DATA_HOME for DATA_DIR + fix icon names + PNG to WebP
- DATA_DIR now always uses XDG_DATA_HOME (~/.local/share/steamlibrarymanager/) instead of relative path - fixes PermissionError on AUR/native installs - Added legacy data migration from old APP_DIR/data location - PKGBUILD: install icons with correct reverse-DNS names for desktop entry - Converted all app images from PNG to WebP (PEGI, defaults, qr_login) - Updated all code references from .png to .webp - Removed unused steam_login icon from toolbar buttons - Updated screenshots with higher quality versions
1 parent 7cb86bf commit e092fb5

56 files changed

Lines changed: 35 additions & 30 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packaging/aur/PKGBUILD

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ LAUNCHER
5151
sed -i "s|^Exec=steam-library-manager|Exec=$pkgname|" \
5252
"$pkgdir/usr/share/applications/io.github.switch_bros.SteamLibraryManager.desktop"
5353

54-
# Icons
55-
install -Dm644 src/resources/icon.png \
56-
"$pkgdir/usr/share/pixmaps/$pkgname.png"
54+
# Icons (must match Icon= in desktop file: io.github.switch_bros.SteamLibraryManager)
5755
install -Dm644 src/resources/icon.svg \
5856
"$pkgdir/usr/share/icons/hicolor/scalable/apps/io.github.switch_bros.SteamLibraryManager.svg"
57+
install -Dm644 src/resources/icon.png \
58+
"$pkgdir/usr/share/icons/hicolor/512x512/apps/io.github.switch_bros.SteamLibraryManager.png"
5959

6060
# Metainfo (for GNOME Software / KDE Discover)
6161
install -Dm644 src/resources/io.github.switch_bros.SteamLibraryManager.metainfo.xml \

src/config.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,9 @@ class Config:
5252
RESOURCES_DIR: Path = get_resources_dir()
5353
ICONS_DIR: Path = RESOURCES_DIR / "icons"
5454

55-
# DATA_DIR must be writable — use XDG on AppImage/Flatpak, local otherwise
56-
DATA_DIR: Path = (
57-
Path(os.environ.get("XDG_DATA_HOME", Path.home() / ".local" / "share")) / "steamlibrarymanager"
58-
if os.environ.get("APPIMAGE") or os.environ.get("FLATPAK_ID")
59-
else APP_DIR / "data"
60-
)
55+
# DATA_DIR must be writable — XDG Base Directory Specification
56+
# Works for all installation types: AUR/native, Flatpak (remaps XDG), AppImage
57+
DATA_DIR: Path = Path(os.environ.get("XDG_DATA_HOME", Path.home() / ".local" / "share")) / "steamlibrarymanager"
6158
CACHE_DIR: Path = DATA_DIR / "cache"
6259
SETTINGS_FILE: Path = DATA_DIR / "settings.json"
6360

@@ -93,8 +90,9 @@ class Config:
9390

9491
def __post_init__(self):
9592
"""Initialize directories and load settings after instantiation."""
96-
self.DATA_DIR.mkdir(exist_ok=True)
97-
self.CACHE_DIR.mkdir(exist_ok=True)
93+
self._migrate_legacy_data_dir()
94+
self.DATA_DIR.mkdir(parents=True, exist_ok=True)
95+
self.CACHE_DIR.mkdir(parents=True, exist_ok=True)
9896

9997
if self.STEAM_LIBRARIES is None:
10098
self.STEAM_LIBRARIES = []
@@ -164,6 +162,22 @@ def grid_folder(self) -> Path | None:
164162

165163
return grid_path
166164

165+
def _migrate_legacy_data_dir(self) -> None:
166+
"""Migrate data from legacy location (relative to install dir) to XDG path.
167+
168+
Before v1.2, DATA_DIR was set to APP_DIR/data for non-AppImage/Flatpak
169+
installs. This migrates any existing data to the XDG-compliant location.
170+
Only runs if old path exists and new path does not.
171+
"""
172+
legacy_data_dir = Path(__file__).resolve().parent.parent / "data"
173+
if legacy_data_dir.is_dir() and not self.DATA_DIR.is_dir():
174+
import shutil
175+
176+
logger.info("Migrating data from %s to %s", legacy_data_dir, self.DATA_DIR)
177+
self.DATA_DIR.mkdir(parents=True, exist_ok=True)
178+
shutil.copytree(legacy_data_dir, self.DATA_DIR, dirs_exist_ok=True)
179+
logger.info("Data migration complete")
180+
167181
def _load_settings(self) -> None:
168182
"""Load settings from JSON file."""
169183
data = load_json(self.SETTINGS_FILE)

src/resources/icons/PEGI12.png

-26.5 KB
Binary file not shown.

src/resources/icons/PEGI12.webp

52.8 KB

src/resources/icons/PEGI16.png

-29 KB
Binary file not shown.

src/resources/icons/PEGI16.webp

51.9 KB

src/resources/icons/PEGI18.png

-31.5 KB
Binary file not shown.

src/resources/icons/PEGI18.webp

57.5 KB

src/resources/icons/PEGI3.png

-17.3 KB
Binary file not shown.

src/resources/icons/PEGI3.webp

55 KB

0 commit comments

Comments
 (0)