2023-12-23 09:56:09 -08:00
|
|
|
#!/usr/bin/bash
|
2023-08-11 00:10:49 -07:00
|
|
|
|
2023-10-08 11:26:07 -07:00
|
|
|
IMAGE_INFO="/usr/share/ublue-os/image-info.json"
|
2023-11-10 13:19:01 -08:00
|
|
|
IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO)
|
2023-10-08 11:26:07 -07:00
|
|
|
|
2023-08-31 09:34:51 -07:00
|
|
|
LAUNCH_OPTIONS=""
|
2023-08-29 09:09:40 -07:00
|
|
|
|
|
|
|
# If Steam has been launched before we can safely launch with -steamdeck
|
|
|
|
# to maintain the gamemode update branch
|
2023-11-10 13:19:01 -08:00
|
|
|
if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME =~ "framegame" ]]; then
|
|
|
|
if [ -f $HOME/.local/share/Steam/ubuntu12_32/steamui.so ]; then
|
|
|
|
LAUNCH_OPTIONS="-steamdeck"
|
|
|
|
fi
|
2023-08-29 09:09:40 -07:00
|
|
|
fi
|
|
|
|
|
2023-11-02 23:48:28 -07:00
|
|
|
if [[ "$XDG_SESSION_TYPE" == "wayland" ]]; then
|
2023-08-11 11:55:29 -07:00
|
|
|
# https://github.com/Supreeeme/extest
|
|
|
|
# Extest is a drop in replacement for the X11 XTEST extension.
|
|
|
|
# It creates a virtual device with the uinput kernel module.
|
|
|
|
# It's been primarily developed for allowing the desktop functionality
|
|
|
|
# on the Steam Controller to work while Steam is open on Wayland.
|
|
|
|
# Also supports Steam Input as a whole.
|
2023-08-31 09:34:51 -07:00
|
|
|
env LD_PRELOAD=/usr/lib/extest/libextest.so /usr/bin/steam "$LAUNCH_OPTIONS" "$*"
|
2023-08-11 00:10:49 -07:00
|
|
|
else
|
2023-12-12 11:21:21 -08:00
|
|
|
/usr/bin/steam "$LAUNCH_OPTIONS" "$@"
|
2023-08-11 00:10:49 -07:00
|
|
|
fi
|