[+] Add cache path variable

#136
This commit is contained in:
Azalea 2023-06-15 07:05:45 -07:00
parent 50abc68f0d
commit 2edf9c1304

View file

@ -1,11 +1,11 @@
from __future__ import annotations from __future__ import annotations
import os
import platform import platform
from dataclasses import dataclass from dataclasses import dataclass
from pathlib import Path from pathlib import Path
from .types import LightDark from .types import LightDark
from .__version__ import VERSION
CONFIG_PATH = Path.home() / '.config/hyfetch.json' CONFIG_PATH = Path.home() / '.config/hyfetch.json'
@ -28,6 +28,8 @@ TEST_ASCII_WIDTH = max(len(line) for line in TEST_ASCII.split('\n'))
DEFAULT_DARK_L = 0. DEFAULT_DARK_L = 0.
IS_WINDOWS = platform.system() == 'Windows' IS_WINDOWS = platform.system() == 'Windows'
CACHE_PATH = Path(os.getenv("LOCALAPPDATA") or os.getenv("XDG_CACHE_HOME") or Path.home() / '.cache') / 'hyfetch'
@dataclass @dataclass
class GlobalConfig: class GlobalConfig:
# Global color mode default to 8-bit for compatibility # Global color mode default to 8-bit for compatibility