Add X-backed Wine install wrapper

This commit is contained in:
Storm Dragon
2026-04-23 15:45:41 -04:00
parent ae4e43cabf
commit c0ac5dbf4b
4 changed files with 49 additions and 1 deletions

View File

@@ -119,6 +119,34 @@ open_url() {
env GAME="$targetUrl" startx
}
run_install_x_command() {
local quotedCommand=""
check_dependencies startx
printf -v quotedCommand '%q ' "$@"
quotedCommand="${quotedCommand% }"
env DISPLAY="${DISPLAY:-:0}" \
STORMUX_X_SESSION_MODE=install \
STORMUX_INSTALL_COMMAND="$quotedCommand" \
startx
}
run_wine_headless() {
local commandName="$1"
shift
command "$commandName" "$@"
}
wine() {
run_install_x_command command wine "$@"
}
winetricks() {
run_install_x_command command winetricks "$@"
}
wait_for_enter() {
local message="$1"

View File

@@ -22,8 +22,9 @@ launchRoot="${launchRoot:-${HOME}/.local/.launch}"
redownload="${redownload:-false}"
ipfsGateway="${ipfsGateway:-https://ipfs.stormux.org}"
fex="${fex:-}"
DISPLAY="${DISPLAY:-:0}"
export installPath cache launchRoot redownload ipfsGateway fex gameName game
export installPath cache launchRoot redownload ipfsGateway fex gameName game DISPLAY
safe_log_name() {
local name="$1"

View File

@@ -35,6 +35,18 @@ start_screen_reader() {
cthulhu &
}
run_install_session_command() {
local installCommand="${STORMUX_INSTALL_COMMAND:-}"
if [[ -z "$installCommand" ]]; then
printf 'Missing STORMUX_INSTALL_COMMAND\n' >&2
return 1
fi
export DISPLAY="${DISPLAY:-:0}"
/bin/bash -lc "$installCommand"
}
check_architecture() {
local architecture
local supportedArch

View File

@@ -30,6 +30,13 @@ export MESA_GL_VERSION_OVERRIDE=3.2
export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
export DBUS_SESSION_BUS_PID
if [[ "${STORMUX_X_SESSION_MODE:-}" == "install" ]]; then
run_install_session_command
launchStatus=$?
pkill -15 Xorg
exit "$launchStatus"
fi
dwm &
xbindkeys