diff --git a/custom_components/easy_computer_manager/computer/__init__.py b/custom_components/easy_computer_manager/computer/__init__.py index b6d4c59..1913a5a 100644 --- a/custom_components/easy_computer_manager/computer/__init__.py +++ b/custom_components/easy_computer_manager/computer/__init__.py @@ -171,13 +171,12 @@ class Computer: async def install_nircmd(self) -> None: """Install NirCmd tool (Windows specific).""" - # Implementation needed - pass + await self.run_action("install_nircmd", params={"download_url": "https://www.nirsoft.net/utils/nircmd.zip", + "install_path": f"C:\\Users\\{self.username}\\AppData\\Local\\EasyComputerManager"}) async def steam_big_picture(self, action: str) -> None: """Start, stop or exit Steam Big Picture mode.""" - # Implementation needed - pass + await self.run_action(f"{action}_steam_big_picture") async def run_action(self, id: str, params=None, raise_on_error: bool = None) -> CommandOutput: """Run a predefined command via SSH.""" diff --git a/custom_components/easy_computer_manager/const.py b/custom_components/easy_computer_manager/const.py index 929c4b2..c74a868 100644 --- a/custom_components/easy_computer_manager/const.py +++ b/custom_components/easy_computer_manager/const.py @@ -75,5 +75,23 @@ ACTIONS = { "command": "bluetoothctl info", "raise_on_error": False, } - } + }, + "install_nirmcd": { + "windows": { + "command": "powershell -Command \"Invoke-WebRequest -Uri %download_url% -OutFile %install_path%\\nircmd.zip -UseBasicParsing; Expand-Archive %install_path%\\nircmd.zip -DestinationPath %install_path%; Remove-Item %install_path%\\nircmd.zip\"", + "params": ["download_url", "install_path"] + } + }, + "start_steam_big_picture": { + "linux": "export WAYLAND_DISPLAY=wayland-0; export DISPLAY=:0; steam -bigpicture &", + "windows": "start steam://open/bigpicture" + }, + "stop_steam_big_picture": { + "linux": "export WAYLAND_DISPLAY=wayland-0; export DISPLAY=:0; steam -shutdown &", + "windows": "C:\\Program Files (x86)\\Steam\\steam.exe -shutdown" + }, + "exit_steam_big_picture": { + "linux": "", # TODO: find a way to exit steam big picture + "windows": "nircmd win close title \"Steam Big Picture Mode\"" + }, } \ No newline at end of file