Files
docker-steam-headless/overlay/etc/cont-init.d/90-configure_steam.sh
2023-10-02 19:43:50 +13:00

36 lines
1004 B
Bash

print_header "Configure Steam"
steam_autostart_desktop="$(cat <<EOF
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Steam
Comment=Launch steam on login
Exec=/usr/games/steam %U ${STEAM_ARGS:-}
Icon=steam
OnlyShowIn=XFCE;
RunHook=0
StartupNotify=false
Terminal=false
Hidden=false
EOF
)"
if [ "${ENABLE_STEAM:-}" = "true" ]; then
if [ "${MODE}" == "s" ] | [ "${MODE}" == "secondary" ]; then
print_step_header "Enable Steam supervisor.d service"
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/steam.ini
else
print_step_header "Enable Steam auto-start script"
mkdir -p "${USER_HOME:?}/.config/autostart"
echo "${steam_autostart_desktop:?}" > "${USER_HOME:?}/.config/autostart/Steam.desktop"
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/steam.ini
fi
else
print_step_header "Disable Steam service"
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/steam.ini
fi
echo -e "\e[34mDONE\e[0m"