Skip to content

Commit 5ca19ba

Browse files
asdf1nitguysoft
authored andcommitted
Add screen rotation
1 parent ef5cb40 commit 5ca19ba

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

src/modules/admin-toolkit/start_chroot_script

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,22 @@ then
158158
unpack /filesystem/tools/scripts /home/"${ADMIN_TOOLKIT_USER_SCRIPTS_NAME}"/scripts ${ADMIN_TOOLKIT_USER_SCRIPTS_NAME}
159159
chmod +x `find /home/"${ADMIN_TOOLKIT_USER_SCRIPTS_NAME}"/scripts -type f`
160160
fi
161+
162+
# Screen Rotation
163+
if [ "$ADMIN_TOOLKIT_SCREEN_ROTATION" != "normal" ]
164+
then
165+
# Handle rotation if the gui module closes after this module
166+
echo "Adding screen rotation..."
167+
if grep -q "GUI_SESSION_PLACEHOLDEFR" /home/pi/scripts/start_gui ; then
168+
sed -i /home/pi/scripts/start_gui -e "s/^GUI_SESSION_PLACEHOLDEFR/export DISPLAY=:0/"
169+
echo "/home/pi/scripts/rotate.sh $ADMIN_TOOLKIT_SCREEN_ROTATION" >> /home/pi/scripts/start_gui
170+
echo 'GUI_SESSION_PLACEHOLDEFR' >> /home/pi/scripts/start_gui
171+
elif grep -q "/home/pi/scripts/run_onepageos" /home/pi/scripts/start_gui ; then
172+
sed -i /home/pi/scripts/start_gui -e "s/^\/home\/pi\/scripts\/run_onepageos/export DISPLAY=:0/"
173+
echo "/home/pi/scripts/rotate.sh $ADMIN_TOOLKIT_SCREEN_ROTATION" >> /home/pi/scripts/start_gui
174+
echo '/home/pi/scripts/run_onepageos' >> /home/pi/scripts/start_gui
175+
else
176+
echo "Couldn't add screen rotation... are you building with the gui module?"
177+
fi
178+
179+
fi

0 commit comments

Comments
 (0)