From f2f8adc85db047cb23313680a4db188d005c6789 Mon Sep 17 00:00:00 2001 From: ericbsd Date: Sun, 21 Dec 2025 22:04:39 -0400 Subject: [PATCH] Add rc.d script for xconfig with X11 auto-configuration --- rc.d/xconfig | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 rc.d/xconfig diff --git a/rc.d/xconfig b/rc.d/xconfig new file mode 100755 index 0000000..876a0c3 --- /dev/null +++ b/rc.d/xconfig @@ -0,0 +1,47 @@ +#!/bin/sh +# +# PROVIDE: xconfig +# REQUIRE: NETWORKING devd +# BEFORE: LOGIN +# +# Add the following line to /etc/rc.conf to enable xconfig: +# +# xconfig_enable="YES" +# + +. /etc/rc.subr + +name="xconfig" +rcvar="xconfig_enable" +desc="Intelligent X11 configuration tool for GhostBSD" + +# Location of the xconfig binary +xconfig_bin="${xconfig_bin:-/usr/local/bin/xconfig}" + +# Log file for xconfig output +xconfig_log="${xconfig_log:-/var/log/xconfig_boot.log}" + +start_cmd="${name}_start" +stop_cmd=":" + +xconfig_start() +{ + if [ ! -x "${xconfig_bin}" ]; then + err 1 "${xconfig_bin} not found or not executable" + fi + + echo "Starting ${name}: Running X11 hardware detection and configuration..." + + # Run xconfig in auto mode for automatic hardware detection + # Redirect output to log file + if "${xconfig_bin}" auto >> "${xconfig_log}" 2>&1; then + echo "${name}: X11 configuration completed successfully" + return 0 + else + warn "${name}: X11 configuration returned non-zero exit status (check ${xconfig_log})" + return 0 # Don't fail boot even if xconfig has issues + fi +} + +load_rc_config $name +run_rc_command "$1" \ No newline at end of file