fix: Handle nested desktop mode a different way in rotation fix.

This commit is contained in:
Kyle Gospodnetich 2024-01-17 18:12:20 -08:00
parent bfae35a384
commit ca069b9418

View File

@ -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.
@ -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