45 lines
1.3 KiB
Bash
Executable File
45 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Clean up stale sockets from previous run
|
|
rm -f /tmp/.X99-lock
|
|
rm -f /tmp/.X11-unix/X99
|
|
rm -rf /tmp/pulse-*
|
|
rm -f /run/user/$(id -u)/pulse/native
|
|
rm -rf /tmp/weston-runtime
|
|
|
|
# Set up Weston runtime directory
|
|
export XDG_RUNTIME_DIR=/tmp/weston-runtime
|
|
mkdir -p $XDG_RUNTIME_DIR
|
|
chmod 700 $XDG_RUNTIME_DIR
|
|
|
|
# Start Weston in headless mode (handles Vulkan/DXVK rendering)
|
|
weston --backend=headless-backend.so --width=800 --height=600 --no-config &
|
|
sleep 2
|
|
export WAYLAND_DISPLAY=wayland-0
|
|
|
|
# Start Xwayland — bridges Weston Wayland to X11 for ximagesrc capture
|
|
Xwayland :99 &
|
|
sleep 1
|
|
export DISPLAY=:99
|
|
|
|
# Suppress Wine crash dialog
|
|
wine reg add "HKCU\\Software\\Wine\\WineDbg" /v ShowCrashDialog /t REG_DWORD /d 0 /f
|
|
|
|
# Start PulseAudio for game audio
|
|
pulseaudio --start --exit-idle-time=-1
|
|
for i in $(seq 1 10); do
|
|
pactl info > /dev/null 2>&1 && break
|
|
echo "Waiting for PulseAudio... attempt $i"
|
|
sleep 1
|
|
done
|
|
|
|
# Virtual microphone
|
|
pactl load-module module-null-sink sink_name=mic_sink
|
|
pactl load-module module-virtual-source source_name=virtual_mic master=mic_sink.monitor
|
|
pactl set-default-source virtual_mic
|
|
|
|
# Launch CSS — Wine uses Wayland driver for rendering via Weston/Vulkan
|
|
wine ~/Counter-Strike\ Source/revLoader.exe &
|
|
sleep 5
|
|
|
|
python3 ~/streaming-agent/gst_agent.py
|