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.
39 lines
899 B
Bash
Executable File
39 lines
899 B
Bash
Executable File
#!/usr/bin/env bash
|
|
###
|
|
# File: start-sunshine.sh
|
|
# Project: bin
|
|
# File Created: Tuesday, 4th October 2022 8:22:17 pm
|
|
# Author: Josh.5 (jsunnex@gmail.com)
|
|
# -----
|
|
# Last Modified: Tuesday, 4th October 2022 8:22:17 pm
|
|
# Modified By: Josh.5 (jsunnex@gmail.com)
|
|
###
|
|
|
|
source /usr/bin/common-functions.sh
|
|
|
|
# CATCH TERM SIGNAL:
|
|
_term() {
|
|
kill -TERM "$sunshine_pid" 2>/dev/null
|
|
}
|
|
trap _term SIGTERM SIGINT
|
|
|
|
|
|
# CONFIGURE:
|
|
# TODO: Install default configurations
|
|
# Reset the default username/password
|
|
if ([ "X${SUNSHINE_USER:-}" != "X" ] && [ "X${SUNSHINE_PASS:-}" != "X" ]); then
|
|
sunshine /home/${USER}/sunshine/sunshine.conf --creds ${SUNSHINE_USER:-} ${SUNSHINE_PASS:-}
|
|
fi
|
|
|
|
|
|
# EXECUTE PROCESS:
|
|
# Wait for the X server to start
|
|
wait_for_x
|
|
# Start the sunshine server
|
|
sunshine min_log_level=info /home/${USER}/sunshine/sunshine.conf &
|
|
sunshine_pid=$!
|
|
|
|
|
|
# WAIT FOR CHILD PROCESS:
|
|
wait "$sunshine_pid"
|