Skip to content

Commit

Permalink
fix: Handle nested desktop mode a different way in rotation fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleGospo committed Jan 18, 2024
1 parent bfae35a commit ca069b9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions system_files/deck/shared/usr/libexec/bazzite-rotation-fix
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,11 @@
# Author: d3Xt3r

SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
IS_GAMEMODE="$(cat /proc/*/comm | grep gamescope-ses*)"

sleep 1
echo $(date '+%Y-%m-%d %H:%M:%S') Starting Bazzite Desktop Orientation Fix script...| tee -a /tmp/bazrotfix.log

IS_GAMEMODE="$(cat /proc/*/comm | grep gamescope-ses*)"

if [[ ! -z "$IS_GAMEMODE" ]]; then
exit 0
fi

# This bit is needed to allow enough time for the desktop to load, otherwise the fix won't work
# Since Steam launches automatically in the Desktop mode in Bazzite-Deck, we can use it
# to determine whether or not the desktop has loaded.
Expand All @@ -30,7 +25,9 @@ kscreen-doctor --outputs 2>&1 | tee -a /tmp/bazrotfix.log
# Fix desktop orientation
# Rotation options: right, normal, left, inverted
echo $(date '+%Y-%m-%d %H:%M:%S') Fixing desktop orientation... | tee -a /tmp/bazrotfix.log
if [[ ":83E1:" =~ ":$SYS_ID" ]]; then
if [[ -z "$IS_GAMEMODE" ]]; then
kscreen-doctor output.1.rotation.normal 2>&1 | tee -a /tmp/bazrotfix.log
elif [[ ":83E1:" =~ ":$SYS_ID" ]]; then
kscreen-doctor output.1.rotation.left 2>&1 | tee -a /tmp/bazrotfix.log
else
kscreen-doctor output.1.rotation.normal 2>&1 | tee -a /tmp/bazrotfix.log
Expand Down

0 comments on commit ca069b9

Please sign in to comment.