Skip to content

Commit 030b538

Browse files
committed
feat: Use HHD on both Legion & Ally
chore: Further setup script cleanup fix(legion): Correct rotation on KDE Wayland (Thanks d3Xt3r)
1 parent c335fde commit 030b538

File tree

4 files changed

+55
-18
lines changed

4 files changed

+55
-18
lines changed

system_files/deck/shared/usr/libexec/bazzite-enable-steam-patch

Whitespace-only changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/usr/bin/bash
2+
3+
# This script fixes the screen orientation in the Desktop Mode in Bazzite-Deck KDE
4+
# Author: d3Xt3r
5+
6+
sleep 1
7+
echo $(date '+%Y-%m-%d %H:%M:%S') Starting Bazzite Desktop Orientation Fix script...| tee -a /tmp/bazrotfix.log
8+
9+
# This bit is needed to allow enough time for the desktop to load, otherwise the fix won't work
10+
# Since Steam launches automatically in the Desktop mode in Bazzite-Deck, we can use it
11+
# to determine whether or not the desktop has loaded.
12+
while ! pgrep -x "steam" > /dev/null; do
13+
echo $(date '+%Y-%m-%d %H:%M:%S') Waiting for Steam to start.. | tee -a /tmp/bazrotfix.log
14+
sleep 0.5
15+
done
16+
17+
sleep 1
18+
19+
# Debug: Get current outputs
20+
kscreen-doctor --outputs 2>&1 | tee -a /tmp/bazrotfix.log
21+
22+
# Fix desktop orientation
23+
# Rotation options: right, normal, left, inverted
24+
echo $(date '+%Y-%m-%d %H:%M:%S') Fixing desktop orientation... | tee -a /tmp/bazrotfix.log
25+
kscreen-doctor output.1.rotation.normal 2>&1 | tee -a /tmp/bazrotfix.log
26+
27+
echo $(date '+%Y-%m-%d %H:%M:%S') Ending Bazzite Desktop Orientation Fix script >> /tmp/bazrotfix.log
28+
echo -e '\n' >> /tmp/bazrotfix.log

system_files/desktop/shared/usr/bin/bazzite-hardware-setup

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ BASE_IMAGE_NAME=$(jq -r '."base-image-name"' < $IMAGE_INFO)
88
FEDORA_VERSION=$(jq -r '."fedora-version"' < $IMAGE_INFO)
99

1010
# SCRIPT VERSION
11-
HWS_VER=19
11+
HWS_VER=20
1212
HWS_VER_FILE="/etc/bazzite/hws_version"
1313
HWS_VER_RAN=$(cat $HWS_VER_FILE)
1414

@@ -164,28 +164,22 @@ if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME =~ "framegam
164164
elif [[ "$(awk '/MemTotal/{print $(NF-1)}' /proc/meminfo)" == "31664740" ]]; then
165165
echo "Jupiter with 32GB RAM detected, disabling BIOS updates..."
166166
systemctl disable --now jupiter-biosupdate.service
167-
else
168-
echo "Jupiter hardware detected, skipping further setup..."
169167
fi
170-
elif [[ ":Galileo:" =~ ":$SYS_ID:" ]]; then
171-
echo "Galileo hardware detected, skipping further setup..."
172168
fi
173169

174170
systemctl enable --now jupiter-fan-control.service
175171
systemctl enable --now vpower.service
176172
systemctl --global enable --now sdgyrodsu.service
177173
else
178174
echo "Generic device detected. Performing setup..."
179-
if [[ ":ROG Ally RC71L_RC71L:AYANEO GEEK:AYANEO 2:AYANEO 2S:AOKZOE A1 AR07:G1618-04:G1619-04:Win600:" =~ ":$SYS_ID:" ]]; then
180-
echo "HandyGCCS supported handheld detected, enabling handycon & TDP control..."
181-
systemctl enable --now handycon.service
182-
sed -i 's/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=0/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=1/g' /etc/default/steam-hardware-control
183-
elif [[ ":83E1:" =~ ":$SYS_ID:" ]]; then
184-
echo "Lenovo Legion detected. Swapping to X11 by default. Disabling handycon & TDP control..."
175+
if [[ ":ROG Ally RC71L_RC71L:83E1:" =~ ":$SYS_ID:" ]]; then
176+
echo "HHD supported handheld detected, disabling handycon & ds-inhibit..."
185177
systemctl disable --now handycon.service
186-
systemctl disable --now ds-inhibit
187-
sed -i 's/DESKTOP_WAYLAND=true/DESKTOP_WAYLAND=false/g' /etc/default/desktop-wayland
188-
sed -i 's/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=1/ENABLE_HARDWARE_CONTROL_ON_NON_DECK_HARDWARE=0/g' /etc/default/steam-hardware-control
178+
systemctl disable --now ds-inhibit.service
179+
elif [[ ":AYANEO GEEK:AYANEO 2:AYANEO 2S:AOKZOE A1 AR07:G1618-04:G1619-04:Win600:" =~ ":$SYS_ID:" ]]; then
180+
echo "HandyGCCS supported handheld detected, enabling handycon & ds-inhibit..."
181+
systemctl enable --now handycon.service
182+
systemctl enable --now ds-inhbit.service
189183
fi
190184
systemctl disable --now jupiter-fan-control.service
191185
systemctl disable --now vpower.service

system_files/desktop/shared/usr/bin/bazzite-user-setup

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ BAZZITE_CONFIG_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/bazzite"
1111
mkdir -p "$BAZZITE_CONFIG_DIR"
1212

1313
# SCRIPT VERSION
14-
USER_SETUP_VER=19
14+
USER_SETUP_VER=20
1515
USER_SETUP_VER_FILE="$BAZZITE_CONFIG_DIR/version"
1616
USER_SETUP_FEDORA_VER_FILE="$BAZZITE_CONFIG_DIR/fedora_version"
1717

@@ -57,7 +57,7 @@ if [[ ! -f "$GRADIENCE_DIR/vgui2.json" ]]; then
5757
cp "$THEME_DIR/vgui2.json" "$GRADIENCE_DIR/vgui2.json"
5858
fi
5959

60-
if [[ $BASE_IMAGE_NAME =~ "kinoite" ]]; then
60+
if [[ $BASE_IMAGE_NAME =~ "kinoite" ]]; then
6161
echo 'Running setup for Kinoite'
6262

6363
echo 'Enabling System76-Scheduler KWin script'
@@ -85,6 +85,7 @@ else
8585
echo 'Running setup for Silverblue on Steam Deck'
8686

8787
echo 'Setting up templates'
88+
mkdir -p "$HOME/Templates"
8889
if [[ ! -f "$HOME/Templates/vkBasalt.conf" ]]; then
8990
ln -s "/etc/vkBasalt.conf" "$HOME/Templates/vkBasalt.conf"
9091
fi
@@ -104,12 +105,26 @@ else
104105
fi
105106
fi
106107

107-
# HHD Setup for Lenovo Legion Go
108+
# Deck Build Setup
108109
if [[ $IMAGE_NAME =~ "deck" ]]; then
109-
if [[ ":83E1:" =~ ":$SYS_ID:" ]]; then
110+
# HHD Setup
111+
if [[ ":ROG Ally RC71L_RC71L:83E1:" =~ ":$SYS_ID:" ]]; then
110112
echo 'Enabling HHD'
111113
pkexec /usr/libexec/bazzite-enable-hhd "$USER"
112114
fi
115+
116+
# Legion Rotation Fix
117+
AUTOSTART_FOLDER=${XDG_CONFIG_HOME:-$HOME/.config}
118+
if [[ ":83E1:" =~ ":$SYS_ID" ]] && [[ $BASE_IMAGE_NAME =~ "kinoite" ]]; then
119+
if [[ ! -f "$AUTOSTART_FOLDER/autostart/legionfix" ]]; then
120+
echo 'Adding legion rotation fix'
121+
mkdir -p "$AUTOSTART_FOLDER/autostart"
122+
ln -s "/usr/libexec/bazzite-handle-legion-go-rotation" "$AUTOSTART_FOLDER/autostart/legionfix"
123+
fi
124+
elif [[ -f "$AUTOSTART_FOLDER/autostart/legionfix" ]]; then
125+
echo 'Non-legion or GNOME detected, removing legionfix'
126+
rm -f "$AUTOSTART_FOLDER/autostart/legionfix"
127+
fi
113128
fi
114129

115130
# Prevent future executions

0 commit comments

Comments
 (0)