Created
February 7, 2022 09:45
-
-
Save strzlee/f96365a724e4d414c334f0510c679ff4 to your computer and use it in GitHub Desktop.
gamescope-session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
source /etc/gamescope-session.conf | |
export SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS=0 | |
# Source environment from ~/.config/environment.d | |
set -a | |
for i in ~/.config/environment.d/*.conf ; | |
do | |
[[ -f "${i}" ]] && source "${i}" | |
done | |
set +a | |
# Use cursor if file exist | |
if [ -z "$CURSOR_FILE" ] ; then | |
CURSOR_FILE="~/.local/share/Steam/tenfoot/resource/images/cursors/arrow.png" | |
fi | |
CURSOR="" | |
if [ -f "$CURSOR_FILE" ] ; then | |
CURSOR="--cursor $CURSOR_FILE" | |
fi | |
# Define session if not overriden | |
if [ -z "$STEAMCMD" ] ; then | |
STEAMCMD="steam -tenfoot -steamos -fulldesktopres -nointro -pipewire-dmabuf" | |
fi | |
if [ -z "$GAMESCOPECMD" ] ; then | |
GAMESCOPECMD="/usr/bin/gamescope $CURSOR -e -f -W $SCREEN_W -H $SCREEN_H -w $RENDER_W -h $RENDER_H" | |
fi | |
# Workaround for Steam login issue while Steam client change propagates out of Beta | |
touch ~/.steam/root/config/SteamAppData.vdf || true | |
# Log rotate the last session | |
if [ -f ~/.steam-tweaks.log ]; then | |
cp ~/.steam-tweaks.log ~/.steam-tweaks.log.old | |
fi | |
if [ -f ~/.steam-stdout.log ]; then | |
cp ~/.steam-stdout.log ~/.steam-stdout.log.old | |
fi | |
# Run steam-tweaks if exists | |
if command -v steam-tweaks > /dev/null; then | |
steam-tweaks > ~/.steam-tweaks.log | |
fi | |
$GAMESCOPECMD -- $STEAMCMD > ~/.steam-stdout.log 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment