Recently I've installed Ubuntu 16.04 on Lenovo ThinkPad X230 Tablet. It works just great! I'm experiencing only two minor problems, both are wired with the convertible screen. This one, that annoys me is the subject of this question.
When I login to Unity the display orientation goes to portrait view mode. So, I must press the screen rotation button to get back to landscape view mode.
The default view within LightDM is landscape. The problem doesn't exist when I unlock Unity, only when I log into. This problem doesn't exist when I login to Gnome. But primary I'm using Unity, so my question is: How do I force Unity to stay in landscape view mode immediately after logging into?
Update 1:
I found that the problem doesn't exist for guest-session and for newly created users.
It looks like some application rotates the display.
I already have tried, without success, some solutions based on the answers of these questions:
Only
xrandr -o normal
placed as command within Startup Applications is a kind of ugly workaround.
Update 2:
- The original title: How do I force Unity to stay in landscape view immediately after logging into?
Finally I managed to understand where the problem comes from:
The tablet has a builtin screen rotation button. I haven't set up anything about this button. It is working by default with Unity/Gnome.
When I press this button the screen is clockwise rotated and the current screen orientation is stored in the file
~/.config/monitors.xml
. This file doesn't exist unless this button is pressed, thus in the guest-session (as it mentioned in the question) the problem doesn't exist.I don't have an idea which "feature" creates this file when I'm pressing the button.
When I'm logging-out, "something" edits the file
~/.config/monitors.xml
(if it exists) and changing the orientation on random pricipal. Maybe "it" attempt to turn the orientation back tonormal
, but "it" doesn't work properly. And this is the issue.To fix this for a certain user, just add the following Cron job -
crontab -e
:normal
with your desired orientation.<rotation>something</rotation>
with<rotation>desired value</rotation>
within the file~/.config/monitors.xml
.Unfortunately this workaround will fix the problem only when you start or reboot the system. When you log-out and log-in the problem may appear again. To fix this you can add your
xrandr
command in the Startup Applications.