From 4dec5a09ce8ab2b4cc1ff7f9bf2e7d39f336f751 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Mon, 4 May 2026 08:41:40 +0000 Subject: [PATCH] fix: anti-idle uses mouse click instead of shift key, interval 60s --- rdp-proxy/manager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rdp-proxy/manager.py b/rdp-proxy/manager.py index eecb086..ae3cb10 100644 --- a/rdp-proxy/manager.py +++ b/rdp-proxy/manager.py @@ -90,7 +90,7 @@ def _anti_idle_loop(): env = {**os.environ, "DISPLAY": DISPLAY} toggle = False while True: - time.sleep(30) + time.sleep(60) with _lock: active = _should_be_connected and _proc is not None and _proc.poll() is None if not active: @@ -102,17 +102,17 @@ def _anti_idle_loop(): ) win_id = r.stdout.decode().strip().splitlines()[0] if r.stdout.strip() else "" if win_id: - x, y = (960, 540) if toggle else (970, 550) + x, y = (5, 5) if toggle else (6, 6) subprocess.run( ["xdotool", "mousemove", "--window", win_id, str(x), str(y)], env=env, capture_output=True, timeout=5, ) subprocess.run( - ["xdotool", "key", "--window", win_id, "--clearmodifiers", "shift"], + ["xdotool", "click", "--window", win_id, "1"], env=env, capture_output=True, timeout=5, ) toggle = not toggle - log.debug("anti_idle jiggle window=%s pos=%s,%s", win_id, x, y) + log.debug("anti_idle click window=%s pos=%s,%s", win_id, x, y) else: log.debug("anti_idle: xfreerdp window not found") except Exception as e: