Files
docker-steam-headless/overlay/usr/bin/common-functions.sh
Josh.5 54911cb97b Fix bug preventing input after the first startup of the container
Xorg was starting before udev could finish the monitor command. This prevented the X server from having access to the input devices. For some reason, any subsequent starts would be fine.

Adding a small delay to the X server start and triggering a request for device events from the kernel after a delay seems to fix this issue.
2022-10-06 22:26:50 +13:00

26 lines
658 B
Bash
Executable File

#!/usr/bin/env bash
###
# File: common-functions.sh
# Project: bin
# File Created: Tuesday, 6th October 2022 9:30:00 pm
# Author: Josh.5 (jsunnex@gmail.com)
# -----
# Last Modified: Tuesday, 6th October 2022 9:30:00 pm
# Modified By: Josh.5 (jsunnex@gmail.com)
###
wait_for_x() {
# Wait for X server to start
# (Credit: https://gist.github.com/tullmann/476cc71169295d5c3fe6)
MAX=60 # About 30 seconds
CT=0
while ! xdpyinfo >/dev/null 2>&1; do
sleep 0.50s
CT=$(( CT + 1 ))
if [ "$CT" -ge "$MAX" ]; then
LOG "FATAL: $0: Gave up waiting for X server $DISPLAY"
exit 11
fi
done
}