This commit is contained in:
liyuhao03 2026-01-20 19:18:06 +08:00
parent 77cfa374ee
commit c9ed713e51
2 changed files with 6 additions and 2 deletions

View file

@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -ex
CHROME_ARGS="--remote-debugging-port=9222 --password-store=basic --no-sandbox --ignore-gpu-blocklist --user-data-dir --no-first-run --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'"
CHROME_ARGS="--remote-debugging-port=9222 --remote-debugging-address=0.0.0.0 --password-store=basic --no-sandbox --ignore-gpu-blocklist --user-data-dir --no-first-run --simulate-outdated-no-au='Tue, 31 Dec 2099 23:59:59 GMT'"
ARCH=$(arch | sed 's/aarch64/arm64/g' | sed 's/x86_64/amd64/g')
if [[ "${DISTRO}" == @(debian|opensuse|ubuntu) ]] && [ ${ARCH} = 'amd64' ] && [ ! -z ${SKIP_CLEAN+x} ]; then

View file

@ -334,8 +334,12 @@ class Recorder:
def _detect_resolution_linux(self):
"""Detect screen resolution on Linux using xdpyinfo."""
try:
# Preserve existing environment and set/override DISPLAY
env = os.environ.copy()
env["DISPLAY"] = self.display
probe = subprocess.check_output(
["xdpyinfo"], env={"DISPLAY": self.display}, stderr=subprocess.DEVNULL
["xdpyinfo"], env=env, stderr=subprocess.DEVNULL
).decode()
for line in probe.splitlines():
if "dimensions:" in line: