From 9477fc8c7ee21ff2b70d8beeba70223480918719 Mon Sep 17 00:00:00 2001 From: Kyle Gospodnetich Date: Sun, 21 Jul 2024 18:31:59 -0700 Subject: [PATCH] feat: Enable HHD on all deck images, previous hardware script now only determines if PPD is used. --- .../deck/shared/usr/libexec/bazzite-enable-hhd | 13 ++++++++++--- .../desktop/shared/usr/libexec/bazzite-user-setup | 13 ++++++------- ...upported-hardware => hhd-tdp-supported-hardware} | 2 +- 3 files changed, 17 insertions(+), 11 deletions(-) rename system_files/desktop/shared/usr/libexec/hwsupport/{hhd-supported-hardware => hhd-tdp-supported-hardware} (85%) diff --git a/system_files/deck/shared/usr/libexec/bazzite-enable-hhd b/system_files/deck/shared/usr/libexec/bazzite-enable-hhd index caa24a5c..fcb4d4c5 100755 --- a/system_files/deck/shared/usr/libexec/bazzite-enable-hhd +++ b/system_files/deck/shared/usr/libexec/bazzite-enable-hhd @@ -9,6 +9,13 @@ fi systemctl enable --now hhd@$(systemd-escape $1).service # Ensure HHD is never running for the root user systemctl disable --now hhd@root.service -# Disable PPD -systemctl disable --now power-profiles-daemon.service -systemctl mask power-profiles-daemon.service + +if /usr/libexec/hwsupport/hhd-tdp-supported-hardware; then + # Disable PPD + systemctl disable --now power-profiles-daemon.service + systemctl mask power-profiles-daemon.service +else + # Restore PPD if previously disabled + systemctl unmask power-profiles-daemon.service + systemctl enable --now power-profiles-daemon.service +fi diff --git a/system_files/desktop/shared/usr/libexec/bazzite-user-setup b/system_files/desktop/shared/usr/libexec/bazzite-user-setup index da400cf8..7d80125c 100755 --- a/system_files/desktop/shared/usr/libexec/bazzite-user-setup +++ b/system_files/desktop/shared/usr/libexec/bazzite-user-setup @@ -169,13 +169,12 @@ fi # Deck Build Setup if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" ]]; then # HHD Setup - if /usr/libexec/hwsupport/hhd-supported-hardware; then - echo 'Enabling HHD' - pkexec /usr/libexec/bazzite-enable-hhd "$USER" - elif /usr/libexec/hwsupport/valve-hardware; then - echo 'Hiding HHD-UI on Deck hardware' - cp /usr/share/applications/hhd-ui.desktop "${XDG_DATA_HOME:-$HOME/.local/share}/applications/hhd-ui.desktop" - sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nNoDisplay=true@g' "${XDG_DATA_HOME:-$HOME/.local/share}/applications/hhd-ui.desktop" + echo 'Enabling HHD' + pkexec /usr/libexec/bazzite-enable-hhd "$USER" + + if [ -f "${XDG_DATA_HOME:-$HOME/.local/share}/applications/hhd-ui.desktop" ]; then + # Remove an old HHD desktop override done on Steam Decks when HHD did not support them + rm "${XDG_DATA_HOME:-$HOME/.local/share}/applications/hhd-ui.desktop" fi # SDGyroDSU Setup diff --git a/system_files/desktop/shared/usr/libexec/hwsupport/hhd-supported-hardware b/system_files/desktop/shared/usr/libexec/hwsupport/hhd-tdp-supported-hardware similarity index 85% rename from system_files/desktop/shared/usr/libexec/hwsupport/hhd-supported-hardware rename to system_files/desktop/shared/usr/libexec/hwsupport/hhd-tdp-supported-hardware index e5dd7db1..7c38bfd4 100755 --- a/system_files/desktop/shared/usr/libexec/hwsupport/hhd-supported-hardware +++ b/system_files/desktop/shared/usr/libexec/hwsupport/hhd-tdp-supported-hardware @@ -1,7 +1,7 @@ #!/usr/bin/bash # Returns true for hardware that is supported by HHD SYS_ID="$(/usr/libexec/hwsupport/sysid)" -if [[ ":ROG Ally RC71L:ROG Ally X RC72LA:83E1:G1618-04:G1617-01:G1619-05:AIR Plus:AIR 1S:AIR 1S Limited:AIR:AYANEO GEEK:AYANEO 2:AYANEO 2S:AOKZOE A1 AR07:AOKZOE A1 Pro:G1619-04:Win600:Loki Max:Loki Zero:Loki MiniPro:V3:" =~ ":$SYS_ID:" ]]; then +if [[ ":ROG Ally RC71L:ROG Ally X RC72LA:83E1:G1618-04:G1617-01:G1619-05:AIR Plus:AIR 1S:AIR 1S Limited:AIR:AYANEO GEEK:AYANEO 2:AYANEO 2S:AOKZOE A1 AR07:AOKZOE A1 Pro:G1619-04:Win600:Loki Max:Loki Zero:Loki MiniPro:" =~ ":$SYS_ID:" ]]; then exit 0 fi