Update docs

This commit is contained in:
FredWuCZ
2024-10-22 20:42:27 +08:00
parent 82878c885c
commit e9dbc3c374
3 changed files with 39 additions and 5 deletions

View File

@@ -0,0 +1,27 @@
# Configuration of Docker
---
Welcome to the Docker VM Management documentation.
## Prerequisite: Check if your machine supports KVM
We recommend running the VM with KVM support. To check if your hosting platform supports KVM, run
```
egrep -c '(vmx|svm)' /proc/cpuinfo
```
on Linux. If the return value is greater than zero, the processor should be able to support KVM.
> **Note**: macOS hosts generally do not support KVM.
## Install Docker
If your hosting platform supports graphical user interface (GUI), you may refer to [Install Docker Desktop on Linux](https://docs.docker.com/desktop/install/linux/) or [Install Docker Desktop on Windows](https://docs.docker.com/desktop/install/windows-install/) based on your OS. Otherwise, you may [Install Docker Engine](https://docs.docker.com/engine/install/).
## Running Experiments
Add the following arguments when initializing `DesktopEnv`:
- `provider`: `docker`
- `os_type`: `Ubuntu` or `Windows`, depending on the OS of the VM

View File

@@ -180,16 +180,19 @@ def capture_screen_with_cursor():
return (cursor, hotspot)
cursor, (hotspotx, hotspoty) = get_cursor()
ratio = ctypes.windll.shcore.GetScaleFactorForDevice(0) / 100
img = ImageGrab.grab(bbox=None, include_layered_windows=True)
pos_win = win32gui.GetCursorPos()
pos = (round(pos_win[0]*ratio - hotspotx), round(pos_win[1]*ratio - hotspoty))
try:
cursor, (hotspotx, hotspoty) = get_cursor()
img.paste(cursor, pos, cursor)
pos_win = win32gui.GetCursorPos()
pos = (round(pos_win[0]*ratio - hotspotx), round(pos_win[1]*ratio - hotspoty))
img.paste(cursor, pos, cursor)
except:
pass
img.save(file_path)
elif user_platform == "Linux":