Skip to content

Commit

Permalink
Merge pull request #166 from games-on-whales/fix/steam-initial-start
Browse files Browse the repository at this point in the history
steam: initial startup
  • Loading branch information
ABeltramo authored Jan 24, 2024
2 parents 74a0e56 + 8b744e7 commit f795c69
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
19 changes: 15 additions & 4 deletions images/steam/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,38 @@ ARG REQUIRED_PACKAGES=" \
steam \
libvulkan1 libvulkan1:i386 \
mesa-vulkan-drivers mesa-vulkan-drivers:i386 \
libdbus-1-3 libgtk-3-0 libegl1 libsdl2-2.0-0 \
libgbm1:i386 libgles2:i386 libegl1:i386 libgl1-mesa-dri:i386 libgl1:i386 libglapi-mesa:i386 libglx0:i386 \
libdbus-1-3 libgtk-3-0 libegl1 libsdl2-2.0-0 libcurl4 libcurl4:i386 \
dbus-daemon dbus-system-bus-common dbus-session-bus-common whoopsie network-manager bluez \
mangoapp ibus \
mangoapp ibus curl pkexec xz-utils zenity file xdg-user-dirs xdg-utils lsof pciutils lsb-release mesa-utils \
libfontconfig1:i386 libfontconfig1:amd64 libfreetype6 libfreetype6:i386 \
"

RUN apt-get update -y && \
apt-get install -y --no-install-recommends software-properties-common && \
apt-get install -y python3-six software-properties-common && \
# \
# Install steam (Steam is 32-bit only) \
dpkg --add-architecture i386 && \
add-apt-repository multiverse && \
apt-get update -y && \
apt-get install -y --no-install-recommends $REQUIRED_PACKAGES && \
# \
# Fix steam updater UI font file \
ln -s /usr/share/fonts/truetype/dejavu /usr/share/fonts/truetype/ttf-dejavu && \
# \
# Cleanup \
apt-get remove -y software-properties-common && \
apt-get remove -y python3-six software-properties-common && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
# fix NetworkManager not picking up devices
RUN touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf

# skip annoying debian dialog
RUN rm /usr/bin/zenity && ln -s /usr/bin/true /usr/bin/zenity

# refresh system font cache. For font warnings on startup see: https://github.com/ValveSoftware/steam-runtime/issues/482
RUN fc-cache -f -v

COPY --chmod=777 scripts/startup.sh /opt/gow/startup-app.sh
COPY --chmod=777 scripts/system-services.sh /etc/cont-init.d/system-services.sh
COPY --chmod=777 steamos-update /usr/bin/steamos-update
Expand Down
9 changes: 5 additions & 4 deletions images/steam/scripts/startup.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ export GTK_IM_MODULE=Steam

if [ -n "$RUN_GAMESCOPE" ]; then
# Enable support for xwayland isolation per-game in Steam
# Note: This breaks without these additional flags
export STEAM_MULTIPLE_XWAYLANDS=1
STEAM_STARTUP_FLAGS="${STEAM_STARTUP_FLAGS} -steamos3 -steamdeck -steampal"
# Note: This breaks without the additional steamdeck flags
#export STEAM_MULTIPLE_XWAYLANDS=1
#STEAM_STARTUP_FLAGS="${STEAM_STARTUP_FLAGS} -steamos3 -steamdeck -steampal"

# We no longer need to set GAMESCOPE_EXTERNAL_OVERLAY from steam, mangoapp now does it itself
export STEAM_DISABLE_MANGOAPP_ATOM_WORKAROUND=1
Expand Down Expand Up @@ -97,12 +97,13 @@ if [ -n "$RUN_GAMESCOPE" ]; then
GAMESCOPE_MODE=${GAMESCOPE_MODE:-"-b"}

# shellcheck disable=SC2086
/usr/games/gamescope ${GAMESCOPE_MODE} --steam --xwayland-count 2 -R $socket -T $stats -W "${GAMESCOPE_WIDTH}" -H "${GAMESCOPE_HEIGHT}" -r "${GAMESCOPE_REFRESH}" &
/usr/games/gamescope -e ${GAMESCOPE_MODE} -R $socket -T $stats -W "${GAMESCOPE_WIDTH}" -H "${GAMESCOPE_HEIGHT}" -r "${GAMESCOPE_REFRESH}" &

# Read the variables we need from the socket
if read -r -t 3 response_x_display response_wl_display <> "$socket"; then
export DISPLAY="$response_x_display"
export GAMESCOPE_WAYLAND_DISPLAY="$response_wl_display"
unset WAYLAND_DISPLAY
# We're done!
else
echo "gamescope failed"
Expand Down

0 comments on commit f795c69

Please sign in to comment.