From 5688afd32262aa599ca0e967dc96dbfa3e668093 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Wed, 21 Aug 2024 03:28:41 +0700 Subject: [PATCH] simplify wrapper script --- anda/games/gamescope/gamescope-legacy.sh | 25 +++++++----------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/anda/games/gamescope/gamescope-legacy.sh b/anda/games/gamescope/gamescope-legacy.sh index 25485be803..3da260e967 100644 --- a/anda/games/gamescope/gamescope-legacy.sh +++ b/anda/games/gamescope/gamescope-legacy.sh @@ -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