mirror of
https://github.com/ublue-os/bazzite.git
synced 2025-01-29 18:32:48 +00:00
parent
a524faac6d
commit
c314aea8fe
@ -3,6 +3,8 @@
|
||||
# This script fixes the screen orientation in the Desktop Mode in Bazzite-Deck KDE
|
||||
# Author: d3Xt3r
|
||||
|
||||
SYS_ID="$(cat /sys/devices/virtual/dmi/id/product_name)"
|
||||
|
||||
sleep 1
|
||||
echo $(date '+%Y-%m-%d %H:%M:%S') Starting Bazzite Desktop Orientation Fix script...| tee -a /tmp/bazrotfix.log
|
||||
|
||||
@ -28,7 +30,11 @@ 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.left 2>&1 | tee -a /tmp/bazrotfix.log
|
||||
if [[ ":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
|
||||
fi
|
||||
|
||||
echo $(date '+%Y-%m-%d %H:%M:%S') Ending Bazzite Desktop Orientation Fix script >> /tmp/bazrotfix.log
|
||||
echo -e '\n' >> /tmp/bazrotfix.log
|
@ -126,16 +126,22 @@ if [[ $IMAGE_NAME =~ "deck" || $IMAGE_NAME =~ "ally" || $IMAGE_NAME =~ "framegam
|
||||
|
||||
# Legion Rotation Fix
|
||||
AUTOSTART_FOLDER=${XDG_CONFIG_HOME:-$HOME/.config}
|
||||
if [[ ":83E1:" =~ ":$SYS_ID" ]] && [[ $BASE_IMAGE_NAME =~ "kinoite" ]]; then
|
||||
if [[ ! -f "$AUTOSTART_FOLDER/autostart/bazzite-handle-legion-go-rotation.desktop" ]]; then
|
||||
echo 'Adding legion rotation fix'
|
||||
mkdir -p "$AUTOSTART_FOLDER/autostart"
|
||||
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"
|
||||
fi
|
||||
elif [[ -f "$AUTOSTART_FOLDER/autostart/bazzite-handle-legion-go-rotation.desktop" ]]; then
|
||||
echo 'Non-legion or GNOME detected, removing legionfix'
|
||||
|
||||
# Remove old legion-only file
|
||||
if [[ -f "$AUTOSTART_FOLDER/autostart/bazzite-handle-legion-go-rotation.desktop" ]]; then
|
||||
rm -f "$AUTOSTART_FOLDER/autostart/bazzite-handle-legion-go-rotation.desktop"
|
||||
fi
|
||||
|
||||
if [[ ":ROG Ally RC71L_RC71L:83E1:" =~ ":$SYS_ID" ]] && [[ $BASE_IMAGE_NAME =~ "kinoite" ]]; then
|
||||
if [[ ! -f "$AUTOSTART_FOLDER/autostart/bazzite-rotation-fix.desktop" ]]; then
|
||||
echo 'Adding rotation fix'
|
||||
mkdir -p "$AUTOSTART_FOLDER/autostart"
|
||||
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"
|
||||
fi
|
||||
elif [[ -f "$AUTOSTART_FOLDER/autostart/bazzite-rotation-fix.desktop" ]]; then
|
||||
echo 'Non-supported or GNOME detected, removing rotaion fix'
|
||||
rm -f "$AUTOSTART_FOLDER/autostart/bazzite-rotation-fix.desktop"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Prevent future executions
|
||||
|
Loading…
x
Reference in New Issue
Block a user