fix(legion): Update rotation direction and exit in a nested session.

This commit is contained in:
Kyle Gospodnetich 2024-01-06 18:48:02 -08:00
parent fea6bd5fe4
commit 927d5b3eca

View File

@ -6,6 +6,12 @@
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.
@ -22,7 +28,7 @@ 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
kscreen-doctor output.1.rotation.normal 2>&1 | tee -a /tmp/bazrotfix.log
kscreen-doctor output.1.rotation.left 2>&1 | tee -a /tmp/bazrotfix.log
echo $(date '+%Y-%m-%d %H:%M:%S') Ending Bazzite Desktop Orientation Fix script >> /tmp/bazrotfix.log
echo -e '\n' >> /tmp/bazrotfix.log