import os

files = [
    ".xinitrc",
    "main.py",
    "README.md",
    "config/settings.json",
    "core/desktop.py",
    "apps/navigateur/app.py",
    "apps/navigateur/browser_engine.py",
    "apps/terminal/app.py",
    "apps/editeur/app.py",
    "apps/xterm/app.py"
]

base_dir = "/home/server/env_gravity/ospython/pythonos_build"

for file in files:
    path = os.path.join(base_dir, file)
    if os.path.exists(path):
        with open(path, 'r', encoding='utf-8') as f:
            content = f.read()
            
        new_content = content.replace("PythonOS", "GrimOS")
        new_content = new_content.replace("pythonos", "grimos")
        
        if content != new_content:
            with open(path, 'w', encoding='utf-8') as f:
                f.write(new_content)
            print(f"Updated {file}")
