Note
This will only work if you use Linux, and your display manager is X11, as it uses the command xrandr
in order to set screen rotation
Warning
If you are using cinnamon, or any other window manager that offers fractional scaling, DISABLE FRACTIONAL SCALING, trust me i know from experience
Also, you may want to consider killing cinnamon so that it goes into fallback mode, which stops flickering when changing angles
I had to do MATHS and TRIGONOMETRY to get this to work properly so you'd better appreciate it
Feel free to open a pull request if you have changes to make, or open an issue if you can't code but want something to be changed or fixed
Yes the monitor is still fully usable.
I have no idea what will happen if you try with multiple monitors, I haven't tried.
To use with a microbit, just upload the python microbit files microbit_on_monitor.py
and microbit_receiver.py
to https://python.microbit.org/v/3/, then save hex files and put them on the microbits.
Ideally, the microbit should be mounted so that the display of the microbit is parallel to the display of your monitor. I would have 3D printed a bracket to attach it to my monitor, but I don't have a 3D printer (yet)
The microbit on the monitor wirelessly transmits to the microbit at the computer
If using with microbits, run pc_microbit_adapter
on the pc. It should automatically detect your monitor and prompt you through a setup process.
The angle will be automatically set when you are rotating your display! It will snap to -90, 0 and 90 degrees, because that's probably what you actually want your monitor set as.
A more practical use case with this, than using wacky rotations, is automatically rotating only between portrait and landscape, which this can do! You are prompted whether to enable it in the setup, and you can edit it in the json file auto_rotate_config.json
-
Install python or use your favourite python interpreter
In a terminal run:
sudo apt install python3
for Debian/Ubuntu/Mint based distrossudo dnf install python3
for Fedora distrossudo yum install python3
for CentOS/RHEL distrossudo pacman -S python
for Arch distros -
Download main.py
-
Open it in python and run it.
Open a terminal in the folder that main.py was downloaded to, and run
python3 ./main.py
- Select your display/resolution if a list is given
- Check that the resolution is correct, since it is likely to be incorrect if the screen has already been rotated by a custom angle
- If the resolution is wrong, or to reset the angle, enter r to reset the angle and reget the resolution. If the resolution is still wrong, enter i to input a custom resolution, and probably open an issue so I can attempt to fix it.
Note
Note that if your display becomes unusable, you can enter r
or 0
as the angle, to reset the rotation
- Enter the angle you want to rotate to (between -90 and 90, or else linux cries in pain). This should rotate automatically, but if it doesn't, you can copy the command starting with
xrandr
that is output, into the terminal.
This was the old cover image
You can have just a slight tilt
You can optimise to have the most lines of code possible from corner to corner. You can also do this to fit the longest lines of code horizontally, so you can finally fit your whole Java class names on one line (fit not guaranteed)