diff --git a/Dockerfile.debian b/Dockerfile.debian index 52f0a69..a3f0cb5 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -186,6 +186,9 @@ RUN \ # Install X Server requirements # TODO: Refine this list of packages to only what is required. +ENV \ + XORG_SOCKET_DIR="/tmp/.X11-unix" \ + XDG_RUNTIME_DIR="/tmp/.X11-unix/run" RUN \ echo "**** Update apt database ****" \ && apt-get update \ @@ -230,6 +233,9 @@ RUN \ echo # Install audio requirements +ENV \ + PULSE_SOCKET_DIR="/tmp/pulse" \ + PULSE_SERVER="unix:/tmp/pulse/pulse-socket" RUN \ echo "**** Update apt database ****" \ && apt-get update \ @@ -297,7 +303,8 @@ RUN \ echo # Add support for flatpaks -# TODO: Remove bridge-utils +ENV \ + XDG_DATA_DIRS="/home/default/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/" RUN \ echo "**** Update apt database ****" \ && apt-get update \ @@ -499,6 +506,25 @@ RUN \ && \ echo +# Install Steam +RUN \ + echo "**** Update apt database ****" \ + && apt-get update \ + && \ + echo "**** Install Intel media drivers and VAAPI ****" \ + && apt-get install -y --no-install-recommends \ + steam \ + && \ + echo "**** Section cleanup ****" \ + && apt-get clean autoclean -y \ + && apt-get autoremove -y \ + && rm -rf \ + /var/lib/apt/lists/* \ + /var/tmp/* \ + /tmp/* \ + && \ + echo + # Add FS overlay COPY overlay / @@ -510,19 +536,10 @@ ENV \ DISPLAY_SIZEW="1600" \ DISPLAY_VIDEO_PORT="DFP" \ DISPLAY=":55" -ENV \ - XORG_SOCKET_DIR="/tmp/.X11-unix" \ - XDG_RUNTIME_DIR="/tmp/.X11-unix/run" \ - XDG_DATA_DIRS="/home/default/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/" ENV \ NVIDIA_DRIVER_CAPABILITIES="all" \ NVIDIA_VISIBLE_DEVICES="all" -# Set pulseaudio environment variables -ENV \ - PULSE_SOCKET_DIR="/tmp/pulse" \ - PULSE_SERVER="unix:/tmp/pulse/pulse-socket" - # Set container configuration environment variables ENV \ MODE="primary" \ @@ -530,12 +547,13 @@ ENV \ ENABLE_VNC_AUDIO="true" \ NEKO_PASSWORD=neko \ NEKO_PASSWORD_ADMIN=admin \ + ENABLE_STEAM="true" \ + STEAM_ARGS="-silent" \ ENABLE_SUNSHINE="false" \ ENABLE_EVDEV_INPUTS="false" # Configure required ports ENV \ - PORT_SSH="" \ PORT_NOVNC_WEB="8083" \ NEKO_NAT1TO1="" diff --git a/overlay/etc/cont-init.d/100-configure_steam_mnt_games.sh b/overlay/etc/cont-init.d/100-configure_steam_mnt_games.sh deleted file mode 100644 index 7ae3775..0000000 --- a/overlay/etc/cont-init.d/100-configure_steam_mnt_games.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -echo "**** Configure Steam /mnt/games steamapps folder ****" - -# Upon first execution of this container, /opt/scripts/install_steam.sh will create a library location named "Mounted -# Games into the /mnt/games/GameLibrary/SteamLibrary location, but not create the required steamapps folder" -# Check /mnt/games to see if it is configured as a Steam Library, and if it is, make sure the steamapps folder exists -MNT_LIBRARY_PATH="/mnt/games/GameLibrary/SteamLibrary" - -if [ -f "$MNT_LIBRARY_PATH/libraryfolder.vdf" ] && [ ! -d "$MNT_LIBRARY_PATH/steamapps" ]; then - mkdir -pm 777 "$MNT_LIBRARY_PATH/steamapps" -fi diff --git a/overlay/etc/cont-init.d/30-configure_udev.sh b/overlay/etc/cont-init.d/30-configure_udev.sh index 14ab3e8..23310b9 100644 --- a/overlay/etc/cont-init.d/30-configure_udev.sh +++ b/overlay/etc/cont-init.d/30-configure_udev.sh @@ -26,8 +26,6 @@ if [[ "${is_privileged}" == "true" ]]; then echo "**** Configure container to run udev management ****"; # Enable supervisord script sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/udev.ini - # Make startup script executable - chmod +x /usr/bin/start-udev.sh # Configure udev permissions if [[ -f /lib/udev/rules.d/60-steam-input.rules ]]; then sed -i 's/MODE="0660"/MODE="0666"/' /lib/udev/rules.d/60-steam-input.rules diff --git a/overlay/etc/cont-init.d/90-configure_steam.sh b/overlay/etc/cont-init.d/90-configure_steam.sh new file mode 100644 index 0000000..62805b8 --- /dev/null +++ b/overlay/etc/cont-init.d/90-configure_steam.sh @@ -0,0 +1,18 @@ + +echo "**** Configure Steam ****" + +if [ "${ENABLE_STEAM:-}" = "true" ]; then + echo "Enable Steam service" + sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/steam.ini + # Remove old autostart script. We should be starting steam with the supervisor service + mkdir -p "${USER_HOME:?}/.config/autostart" + # if grep "Exec=/usr/bin/flatpak" "${USER_HOME:?}/.config/autostart/Steam.desktop" &> /dev/null; then + # rm -fv "${USER_HOME:?}/.config/autostart/Steam.desktop" + # fi + rm -fv "${USER_HOME:?}/.config/autostart/Steam.desktop" +else + echo "Disable Steam service" + sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/steam.ini +fi + +echo "DONE" diff --git a/overlay/etc/cont-init.d/95-configure_secondary.sh b/overlay/etc/cont-init.d/95-configure_secondary.sh index e4db3eb..2adc94c 100644 --- a/overlay/etc/cont-init.d/95-configure_secondary.sh +++ b/overlay/etc/cont-init.d/95-configure_secondary.sh @@ -31,7 +31,7 @@ if [ "${MODE}" == "s" ] | [ "${MODE}" == "secondary" ]; then sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/udev.ini fi -# TODO: Disabled some stuff for development... re-enable it after Archis working +# TODO: Disabled some stuff for development... re-enable it after Arch is working echo " - DISABLEING dind" sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/dind.ini #echo " - DISABLEING desktop" diff --git a/overlay/etc/supervisor.d/steam.ini b/overlay/etc/supervisor.d/steam.ini index 17b2f14..1421194 100644 --- a/overlay/etc/supervisor.d/steam.ini +++ b/overlay/etc/supervisor.d/steam.ini @@ -10,8 +10,7 @@ autorestart=true startretries=50 user=%(ENV_USER)s directory=/home/%(ENV_USER)s -# command=/usr/games/steam -bigpicture -command=/usr/games/steam +command=/usr/games/steam %(STEAM_ARGS)s environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" stopsignal=INT stdout_logfile=/home/%(ENV_USER)s/.cache/log/steam.log diff --git a/overlay/opt/scripts/install_steam.sh b/overlay/opt/scripts/install_steam.sh deleted file mode 100755 index 3f10ab2..0000000 --- a/overlay/opt/scripts/install_steam.sh +++ /dev/null @@ -1,78 +0,0 @@ -#!/usr/bin/env bash - -echo "**** Installing/upgrading Steam via flatpak ****" - -# Install Steam client -flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo -flatpak --user install --assumeyes --or-update flathub com.valvesoftware.Steam -# Configure any required overrides -flatpak --user override --filesystem=/mnt/games com.valvesoftware.Steam -# TODO: Check if we should add /dev/dri here?? - -# Configure default steam library paths -echo "Configure Steam default libraries..." -mkdir -p /mnt/games/GameLibrary/SteamLibrary -libraryfolders="$(cat < ${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam/steamapps/libraryfolders.vdf -fi -if [[ ! -f ${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam/config/libraryfolders.vdf ]]; then - mkdir -p ${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam/config - echo "${libraryfolders}" > ${USER_HOME:?}/.var/app/com.valvesoftware.Steam/.local/share/Steam/config/libraryfolders.vdf -fi -# Remove old autostart script if pointing to old native debian steam launcher -mkdir -p "${USER_HOME:?}/.config/autostart" -if grep "Exec=/usr/games/steam %U" "${USER_HOME:?}/.config/autostart/Steam.desktop" &> /dev/null; then - rm -fv "${USER_HOME:?}/.config/autostart/Steam.desktop" -fi -# Create autostart script if missing -steam_autostart_desktop="$(cat < "${USER_HOME:?}/.config/autostart/Steam.desktop" -fi - -echo "DONE" diff --git a/overlay/usr/bin/start-desktop.sh b/overlay/usr/bin/start-desktop.sh index 9ba3b27..467db3b 100755 --- a/overlay/usr/bin/start-desktop.sh +++ b/overlay/usr/bin/start-desktop.sh @@ -28,7 +28,6 @@ wait_for_x # Install/Upgrade user apps if [[ ! -f /tmp/.desktop-apps-updated.lock ]]; then xterm -geometry 200x50+0+0 -ls -e /bin/bash -c " - source /opt/scripts/install_steam.sh; source /opt/scripts/install_firefox.sh; source /opt/scripts/install_protonup.sh; source /opt/scripts/install_sunshine.sh;