Revert to starting steam from desktop autostart

This commit is contained in:
Josh.5
2023-08-22 15:02:35 +12:00
committed by Josh Sunnex
parent 5837843aa2
commit 02a94566b2
2 changed files with 24 additions and 13 deletions

View File

@@ -1,15 +1,31 @@
echo "**** 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
# 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"
if [ "${MODE}" == "s" ] | [ "${MODE}" == "secondary" ]; then
echo "Enable Steam supervisor.d service"
sed -i 's|^autostart.*=.*$|autostart=true|' /etc/supervisor.d/steam.ini
else
echo "Enable Steam auto-start script"
mkdir -p "${USER_HOME:?}/.config/autostart"
echo "${steam_autostart_desktop:?}" > "${USER_HOME:?}/.config/autostart/Steam.desktop"
fi
else
echo "Disable Steam service"
sed -i 's|^autostart.*=.*$|autostart=false|' /etc/supervisor.d/steam.ini

View File

@@ -41,10 +41,5 @@ echo "**** Starting Xfce4 ****"
/usr/bin/startxfce4 &
desktop_pid=$!
if [ "${ENABLE_STEAM:-}" = "true" ]; then
echo "Start Steam service"
sudo supervisorctl start steam
fi
# WAIT FOR CHILD PROCESS:
wait "$desktop_pid"