Files
Modus/snippets/__init__.py
T
2025-02-13 16:40:47 +05:45

27 lines
739 B
Python

from .animator import *
from .custom_image import *
from .icon import *
import json
import os
from fabric.utils import get_relative_path
def read_config():
config_path = get_relative_path("../config/assets/launcher.json")
with open(config_path, "r") as file:
# Load JSON data into a Python dictionary
data = json.load(file)
return data
default_wallpapers_dir = get_relative_path("../assets/wallpaper")
json_config_path = get_relative_path("../config/assets/config.json")
if os.path.exists(json_config_path):
with open(json_config_path, "r") as f:
config = json.load(f)
WALLPAPERS_DIR = config.get("wallpapers_dir", default_wallpapers_dir)
else:
WALLPAPERS_DIR = default_wallpapers_dir