Skip to content

Commit

Permalink
simplify wrapper script
Browse files Browse the repository at this point in the history
  • Loading branch information
korewaChino committed Aug 20, 2024
1 parent 467dad8 commit 5688afd
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions anda/games/gamescope/gamescope-legacy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,16 @@
gamescope_path="/usr/bin/gamescope"


# Extra configuration for the people who need it, at $XDG_CONFIG_HOME/gamescope/legacy.conf or /etc/gamescope/legacy.conf
# Should import an GAMESCOPE_LEGACY_ARGS variable
#
# We should document this in Fyra Devdocs later


if [ -f "$XDG_CONFIG_HOME/gamescope/legacy.conf" ]; then
. "$XDG_CONFIG_HOME/gamescope/legacy.conf"
elif [ -f "/etc/gamescope/legacy.conf" ]; then
. "/etc/gamescope/legacy.conf"
else
GAMESCOPE_LEGACY_ARGS=""
# check if $BACKEND is already defined
# todo: Probably want to patch gamescope-session-plus for this instead meow
LEGACY_BACKEND_ARGS=""
if [ -z "$BACKEND" ]; then
LEGACY_BACKEND_ARGS="--backend=sdl"
fi


# Check if we have a $DISPLAY variable, because if not then we're probably not
# running nested

if [ -z "$DISPLAY" ]; then
$gamescope_path --backend=drm --expose-wayland $GAMESCOPE_LEGACY_ARGS $@
$gamescope_path $LEGACY_BACKEND_ARGS $@
else
$gamescope_path --backend=sdl $GAMESCOPE_LEGACY_ARGS $@
$gamescope_path $LEGACY_BACKEND_ARGS $@
fi

0 comments on commit 5688afd

Please sign in to comment.