Add rotate screen button to Control Center
See original GitHub issueHi,
I was wondering if a rotate screen button could be added to Control Center. It would give visual feedback as to what rotation the screen has and prompt the user after 3 seconds if they want to reboot the pi (the delay would give the user enough time to click the button multiple times until they get the desired rotation, every time they click the button the timer would reset).
After reboot the changes should take into effect!
These are the instructions on how to rotate the screen of the raspberry pi:
Here’s a bash script I wrote that rotates the screen of the RaspberryPi:
#!/bin/bash
# run with sudo
# reboot raspberry pi for changes to take effect
CONFIG='/boot/config.txt'
# save default configuration file
if [ ! -f $CONFIG.save ]; then
cp $CONFIG $CONFIG.save
fi
# get the rotation of the file
ROTATION=$(tail -1 $CONFIG)
# override current config file to remove changes
cp $CONFIG.save $CONFIG
# rotate clause
if [ $ROTATION == 'display_rotate=0' ]; then
echo 'display_rotate=1' >> $CONFIG
echo 'display_rotate=1'
elif [ $ROTATION == 'display_rotate=1' ]; then
echo 'display_rotate=2' >> $CONFIG
echo 'display_rotate=2'
elif [ $ROTATION == 'display_rotate=2' ]; then
echo 'display_rotate=3' >> $CONFIG
echo 'display_rotate=3'
elif [ $ROTATION == 'display_rotate=3' ]; then
echo 'display_rotate=0' >> $CONFIG
echo 'display_rotate=0'
else
echo 'display_rotate=1' >> $CONFIG
echo 'display_rotate=1'
fi
You could spawn a process that executes this script and the output of the script would give you the current rotation of the screen.
If you need any help adding this enhancement, I’d be happy to help!
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top GitHub Comments
@istvanfedak I brought in your pull request to the develop branch yesterday. I’m doing a total rework of the cli options, and once that’s all done and merged up into develop, i’ll get your code fully integrated into the package
Awesome! Thanks