diff --git a/Containerfile b/Containerfile index a78b211e..2a547030 100644 --- a/Containerfile +++ b/Containerfile @@ -350,7 +350,8 @@ RUN rpm-ostree install \ wget https://gitlab.com/evlaV/linux-firmware-neptune/-/raw/jupiter/cs35l41-dsp1-spk-prot.wmfw -O /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-prot.wmfw && \ xz --check=crc32 /tmp/linux-firmware-neptune/cs35l41-dsp1-spk-{cali.bin,cali.wmfw,prot.bin,prot.wmfw} && \ mv -vf /tmp/linux-firmware-neptune/* /usr/lib/firmware/cirrus/ && \ - rm -rf /tmp/linux-firmware-neptune + rm -rf /tmp/linux-firmware-neptune && \ + wget $(jq -r '.assets[].browser_download_url | select(endswith("steam-patch"))' <<< $(curl -s 'https://api.github.com/repos/Maclay74/steam-patch/releases' | jq -r "first(.[] | select(.prerelease == "false"))")) -O /usr/bin/steam-patch # Install Steam and Lutris into their own OCI layer # Add bootstraplinux_ubuntu12_32.tar.xz used by gamescope-session (Thanks ChimeraOS! - https://chimeraos.org/) diff --git a/system_files/deck/shared/usr/lib/systemd/user/steam-patch.service b/system_files/deck/shared/usr/lib/systemd/user/steam-patch.service new file mode 100644 index 00000000..1271b52f --- /dev/null +++ b/system_files/deck/shared/usr/lib/systemd/user/steam-patch.service @@ -0,0 +1,11 @@ +[Unit] +Description=Steam Patches Loader +Wants=network.target +After=network.target + +[Service] +Type=simple +ExecStart=/usr/bin/pkexec /usr/bin/steam-patch --user=%u + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/system_files/deck/shared/usr/share/polkit-1/actions/org.bazzite.steam-fix.policy b/system_files/deck/shared/usr/share/polkit-1/actions/org.bazzite.steam-fix.policy new file mode 100644 index 00000000..4b9db607 --- /dev/null +++ b/system_files/deck/shared/usr/share/polkit-1/actions/org.bazzite.steam-fix.policy @@ -0,0 +1,21 @@ + + + + + Bazzite + https://github.com/ublue-os/bazzite/ + + + Some Steam patches, fixing broken Steam features on Asus Rog Ally and other third-party handhelds + package-x-generic + + yes + yes + yes + + /usr/bin/steam-patch + + + diff --git a/system_files/deck/shared/usr/share/polkit-1/rules.d/70-steam-fix.rules b/system_files/deck/shared/usr/share/polkit-1/rules.d/70-steam-fix.rules new file mode 100644 index 00000000..528de951 --- /dev/null +++ b/system_files/deck/shared/usr/share/polkit-1/rules.d/70-steam-fix.rules @@ -0,0 +1,6 @@ +polkit.addRule(function(action, subject) { + if (action.id == "org.bazzite.steam-patch.pkexec" && + subject.isInGroup("wheel")) { + return polkit.Result.YES; + } +}); \ No newline at end of file diff --git a/system_files/desktop/shared/usr/bin/bazzite-hardware-setup b/system_files/desktop/shared/usr/bin/bazzite-hardware-setup index 2d679067..7991d3c2 100755 --- a/system_files/desktop/shared/usr/bin/bazzite-hardware-setup +++ b/system_files/desktop/shared/usr/bin/bazzite-hardware-setup @@ -6,7 +6,7 @@ IMAGE_FLAVOR=$(jq -r '."image-flavor"' < $IMAGE_INFO) BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO) # SCRIPT VERSION -HWS_VER=4 +HWS_VER=5 HWS_VER_FILE="/etc/bazzite/hws_version" HWS_VER_RAN=$(cat $HWS_VER_FILE) @@ -19,6 +19,7 @@ KNOWN_IMAGE_FLAVOR=$(cat $KNOWN_IMAGE_FLAVOR_FILE) # GLOBAL SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)" GPU_ID=$(lspci -k | grep -A 3 -E "(VGA|3D)") +PRODUCT_NAME="$(cat /sys/devices/virtual/dmi/id/product_name)" KARGS=$(rpm-ostree kargs) NEEDED_KARGS="" echo "Current kargs: $KARGS" @@ -139,12 +140,23 @@ if [[ -f $HWS_VER_FILE && $HWS_VER = $HWS_VER_RAN ]]; then fi if [[ $IMAGE_NAME =~ "deck" ]]; then - if [[ ":Jupiter:" =~ ":$SYS_ID:" ]]; then - # Future updates to deck on jupiter here + if [[ ":Jupiter:" =~ ":$SYS_ID:" ]]; then + # Future updates to Deck on Jupiter here else echo "Generic device detected. Performing setup..." - - systemctl enable --now handycon.service + if [[ \ + ":AYA NEO:AYANEO:AIR Plus:" =~ ":$PRODUCT_NAME:" || \ + "ONEXPLAYER" =~ "$PRODUCT_NAME" || \ + "AOKZOE" =~ "$PRODUCT_NAME" || \ + ":G1619-01:G1621-02:MicroPC:" =~ ":$SYS_ID:" \ + ]]; then + echo "HandyGCCS supported handheld detected, enabling handycon & steam-patch." + systemctl enable --now handycon.service + systemctl enable --now --global steam-patch.service + elif [[ ":ROG Ally RC71L_RC71L:" =~ ":$SYS_ID:" ]] + echo "ROG Ally detected. Enabling steam-patch." + systemctl enable --now --global steam-patch.service + fi systemctl disable --now jupiter-fan-control.service systemctl disable --now vpower.service systemctl disable --now jupiter-biosupdate.service diff --git a/system_files/desktop/shared/usr/bin/bazzite-user-setup b/system_files/desktop/shared/usr/bin/bazzite-user-setup index e8f329ae..3d9ce815 100755 --- a/system_files/desktop/shared/usr/bin/bazzite-user-setup +++ b/system_files/desktop/shared/usr/bin/bazzite-user-setup @@ -1,7 +1,7 @@ #!/usr/bin/env bash # SCRIPT VERSION -USER_SETUP_VER=2 +USER_SETUP_VER=3 USER_SETUP_VER_FILE="$HOME/.bazzite-configured" USER_SETUP_VER_RAN=$(cat $USER_SETUP_VER_FILE) @@ -14,6 +14,8 @@ fi IMAGE_INFO="/usr/share/ublue-os/image-info.json" IMAGE_NAME=$(jq -r '."image-name"' < $IMAGE_INFO) BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO) +SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)" +PRODUCT_NAME="$(cat /sys/devices/virtual/dmi/id/product_name)" if [[ $BASE_IMAGE_NAME =~ "kinoite" ]]; then echo 'Running setup for Kinoite' @@ -109,6 +111,18 @@ else fi fi +# Steam Patch setup +if [[ \ + ":ROG Ally RC71L_RC71L:" =~ ":$SYS_ID:" || \ + ":AYA NEO:AYANEO:AIR Plus:" =~ ":$PRODUCT_NAME:" || \ + "ONEXPLAYER" =~ "$PRODUCT_NAME" || \ + "AOKZOE" =~ "$PRODUCT_NAME" || \ + ":G1619-01:G1621-02:MicroPC:" =~ ":$SYS_ID:" \ + ]]; then + mkdir -p "$HOME/.steam/steam/" + touch "$HOME/.steam/steam/.cef-enable-remote-debugging" +fi + # Enable NTP timedatectl set-ntp true