import webbrowser
import subprocess
import pyautogui


class SystemCommands:
    @staticmethod
    def open_app(app_name):
        if "chrome" in app_name.lower():
            webbrowser.open("https://google.com")
        elif "notepad" in app_name.lower():
            subprocess.Popen(["notepad.exe"])
        return f"Opening {app_name}"

    @staticmethod
    def take_screenshot():
        pyautogui.screenshot("screenshot.png")
        return "Screenshot saved"

    @staticmethod
    def search_web(query):
        webbrowser.open(f"https://www.google.com/search?q={query}")
        return f"Searching for {query}"
