implement nircmd instlal and steam actions

This commit is contained in:
Mathieu Broillet 2024-08-30 10:12:22 +02:00
parent 767d877442
commit eaf434efc8
Signed by: mathieu
GPG Key ID: A08E484FE95074C1
2 changed files with 22 additions and 5 deletions

View File

@ -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."""

View File

@ -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\""
},
}