Fix Chromium autofill timing bug + RDP anti-idle to prevent lock screen
- universal-runtime: set _state[profile_dir] AFTER _start_process so _stop_current does not delete the freshly-created profile before Chromium reads it. Without this, Login Data was being wiped. - rdp-proxy: add xdotool dependency and background anti_idle_loop that sends Shift to the xfreerdp window every 30s, forwarded over RDP to reset the remote idle timer and keep the lock screen from kicking in.
This commit is contained in:
+20
-1
@@ -221,9 +221,28 @@ X11VNC_PID=$!
|
||||
websockify --verbose --idle-timeout="$IDLE_TIMEOUT" --web=/opt/portal 6080 localhost:5900 >/tmp/websockify.log 2>&1 &
|
||||
WEBSOCKIFY_PID=$!
|
||||
|
||||
|
||||
# Anti-idle: send Shift key to xfreerdp window every 30s to prevent remote lock screen
|
||||
anti_idle_loop() {
|
||||
sleep 5
|
||||
while true; do
|
||||
WID=$(DISPLAY="$DISPLAY_NUM" xdotool search --pid "$XFREERDP_PID" 2>/dev/null | head -1)
|
||||
if [ -n "$WID" ]; then
|
||||
DISPLAY="$DISPLAY_NUM" xdotool key --window "$WID" shift 2>/dev/null || true
|
||||
else
|
||||
DISPLAY="$DISPLAY_NUM" xdotool mousemove --sync 500 300 2>/dev/null || true
|
||||
sleep 1
|
||||
DISPLAY="$DISPLAY_NUM" xdotool mousemove --sync 600 400 2>/dev/null || true
|
||||
fi
|
||||
sleep 30
|
||||
done
|
||||
}
|
||||
anti_idle_loop &
|
||||
ANTI_IDLE_PID=$!
|
||||
|
||||
# Graceful shutdown on docker stop (SIGTERM) — exit 0 so Docker does NOT auto-restart
|
||||
cleanup() {
|
||||
kill "$XFREERDP_PID" "$X11VNC_PID" "$WEBSOCKIFY_PID" 2>/dev/null
|
||||
kill "$XFREERDP_PID" "$X11VNC_PID" "$WEBSOCKIFY_PID" "$ANTI_IDLE_PID" 2>/dev/null
|
||||
exit 0
|
||||
}
|
||||
trap cleanup TERM INT
|
||||
|
||||
Reference in New Issue
Block a user