import json
import os

def load_settings():
    path = os.path.join(os.path.dirname(__file__), '..', 'config', 'settings.json')
    try:
        with open(path, 'r', encoding='utf-8') as f:
            return json.load(f)
    except Exception as e:
        print(f"Erreur chargement settings: {e}")
        return {
            "resolution": "1024x768",
            "background": "gray",
            "fullscreen": False
        }

def load_applications():
    path = os.path.join(os.path.dirname(__file__), '..', 'config', 'applications.json')
    try:
        with open(path, 'r', encoding='utf-8') as f:
            return json.load(f)
    except Exception as e:
        print(f"Erreur chargement applications: {e}")
        return []
