I had a dedicated key for auto rotate on/off on my laptop which worked in Windows but in not Ubuntu. I’m glad because I got to learn a new command called xrandr. I remember this by thinking of x random r.
It is really neat and I recommend you running these commands and experiment. These are the commands you want to run:
xrandr --output eDP1 --rotate right xrandr --output eDP1 --rotate left xrandr --output eDP1 --rotate normal xrandr --output eDP1 --rotate inverted
Replace eDP1 with the name of your desired display.
Nice, but how to apply this.
Than after restart PC you do not have to make command again.