Skip to content

Commit c314aea

Browse files
committed
fix(ally): Correct rotation in KDE
Fixes #680
1 parent a524faa commit c314aea

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

system_files/deck/shared/usr/libexec/bazzite-handle-legion-go-rotation system_files/deck/shared/usr/libexec/bazzite-rotation-fix

+7-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# This script fixes the screen orientation in the Desktop Mode in Bazzite-Deck KDE
44
# Author: d3Xt3r
55

6+
SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
7+
68
sleep 1
79
echo $(date '+%Y-%m-%d %H:%M:%S') Starting Bazzite Desktop Orientation Fix script...| tee -a /tmp/bazrotfix.log
810

@@ -28,7 +30,11 @@ kscreen-doctor --outputs 2>&1 | tee -a /tmp/bazrotfix.log
2830
# Fix desktop orientation
2931
# Rotation options: right, normal, left, inverted
3032
echo $(date '+%Y-%m-%d %H:%M:%S') Fixing desktop orientation... | tee -a /tmp/bazrotfix.log
31-
kscreen-doctor output.1.rotation.left 2>&1 | tee -a /tmp/bazrotfix.log
33+
if [[ ":83E1:" =~ ":$SYS_ID" ]]; then
34+
kscreen-doctor output.1.rotation.left 2>&1 | tee -a /tmp/bazrotfix.log
35+
else
36+
kscreen-doctor output.1.rotation.normal 2>&1 | tee -a /tmp/bazrotfix.log
37+
fi
3238

3339
echo $(date '+%Y-%m-%d %H:%M:%S') Ending Bazzite Desktop Orientation Fix script >> /tmp/bazrotfix.log
3440
echo -e '\n' >> /tmp/bazrotfix.log

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

+13-7
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,21 @@ if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME =~ "framegam
126126

127127
# Legion Rotation Fix
128128
AUTOSTART_FOLDER=${XDG_CONFIG_HOME:-$HOME/.config}
129-
if [[ ":83E1:" =~ ":$SYS_ID" ]] && [[ $BASE_IMAGE_NAME =~ "kinoite" ]]; then
130-
if [[ ! -f "$AUTOSTART_FOLDER/autostart/bazzite-handle-legion-go-rotation.desktop" ]]; then
131-
echo 'Adding legion rotation fix'
129+
130+
# Remove old legion-only file
131+
if [[ -f "$AUTOSTART_FOLDER/autostart/bazzite-handle-legion-go-rotation.desktop" ]]; then
132+
rm -f "$AUTOSTART_FOLDER/autostart/bazzite-handle-legion-go-rotation.desktop"
133+
fi
134+
135+
if [[ ":ROG Ally RC71L_RC71L:83E1:" =~ ":$SYS_ID" ]] && [[ $BASE_IMAGE_NAME =~ "kinoite" ]]; then
136+
if [[ ! -f "$AUTOSTART_FOLDER/autostart/bazzite-rotation-fix.desktop" ]]; then
137+
echo 'Adding rotation fix'
132138
mkdir -p "$AUTOSTART_FOLDER/autostart"
133-
printf "[Desktop Entry]\nExec=/usr/libexec/bazzite-handle-legion-go-rotation\nIcon=dialog-scripts\nName=bazzite-handle-legion-go-rotation\nType=Application\nX-KDE-AutostartScript=true\n" > "$AUTOSTART_FOLDER/autostart/bazzite-handle-legion-go-rotation.desktop"
139+
printf "[Desktop Entry]\nExec=/usr/libexec/bazzite-rotation-fix\nIcon=dialog-scripts\nName=bazzite-rotation-fix\nType=Application\nX-KDE-AutostartScript=true\n" > "$AUTOSTART_FOLDER/autostart/bazzite-rotation-fix.desktop"
134140
fi
135-
elif [[ -f "$AUTOSTART_FOLDER/autostart/bazzite-handle-legion-go-rotation.desktop" ]]; then
136-
echo 'Non-legion or GNOME detected, removing legionfix'
137-
rm -f "$AUTOSTART_FOLDER/autostart/bazzite-handle-legion-go-rotation.desktop"
141+
elif [[ -f "$AUTOSTART_FOLDER/autostart/bazzite-rotation-fix.desktop" ]]; then
142+
echo 'Non-supported or GNOME detected, removing rotaion fix'
143+
rm -f "$AUTOSTART_FOLDER/autostart/bazzite-rotation-fix.desktop"
138144
fi
139145
fi
140146

0 commit comments

Comments
 (0)