Dotfiles/desktopenvs/hyprdrive/supersonic-booster/paths.py

23 lines
761 B
Python

"""Shared filesystem locations. Works whether run from the repo or ~/.config."""
from __future__ import annotations
import os
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent
STYLE_DIR = BASE_DIR / "style"
# User settings live under XDG_STATE_HOME, NOT ~/.config — config-updater does
# `rm -rf ~/.config/supersonic-booster` on every dotfiles sync (see orbit-menu/
# horizon-dock/paths.py for the same rationale), which would wipe a hand-edited
# config on the spot.
STATE_DIR = Path(os.environ.get("XDG_STATE_HOME", Path.home() / ".local" / "state")) / "supersonic-booster"
CONFIG_FILE = STATE_DIR / "config.json"
APP_ID = "eu.abdelbaki.supersonicbooster"
def ensure_dirs() -> None:
STATE_DIR.mkdir(parents=True, exist_ok=True)