I rotated my screen, and once I login, it works fine. But, the greeter (login) screen hasn't got the message that things are rotated 90 degrees. How can I change the rotation of the login screen?
UPDATE: lock screen is in correct position. I only see this when I boot, or log out.
Add this line to the
/etc/lightdm/lightdm.conf
file (in the [SeatDefaults] section):Then make the file
/etc/lightdm/greeter_setup.sh
with the following contents:Then make it executable with
sudo chmod +x /etc/lightdm/greeter_setup.sh
. Then reboot.Another option that should work is to copy
~/.config/monitors.xml
to/var/lib/lightdm/.config
.This certainly works for my monitor position and resolution information, so I would assume it would work for rotation too.
Edit: For maximum flexibility, one could make a symbolic link between the above:
This way, if your monitor setup changes in the future, it will automatically reflected to the login screen. Notice the necessary
-h
flag on thechown
command, as explained in chown is not changing symbolic link.14.04 and above
Falconer's answer helped me very much, but lightdm changed for Ubuntu Trusty 14.04. There is no longer a
/etc/lightdm/lightdm.conf
file on my system. lightdm has now gone the "Debian way" and had its configuration broken up into a conf.d directory. You now need to create the following file:/etc/lightdm/lightdm.conf.d/80-display-setup.conf
As suggested in Electric Head's answer, the xrandr command can go right in this file, no need to create a separate script.
If you want a xrandr command that deals with multiple monitors, you can use
arandr
to generate it for you. Myxrandr
command actually ends up being:To get that I used the following commands:
sudo apt-get install arandr
arandr
With this in place, my monitors are properly rotated when I log in as well, so there is no need to do additional configuration in Gnome, XFCE, or KDE. The only other place that I need to configure monitor rotation is in virtual framebuffer terminals, as explained in How do I rotate my display when not using an X Server?
falconer pretty much nailed it but I'd like to point out a simplification.
You can put an
xrandr
command directly in/etc/lightdm/lightdm.conf
as a system hook. You don't need to create a shell command to call a separate script containing a shell command (though of course you can if you see a reason to do so). Also, there's no mention of/etc/lightdm/lightdm.conf.d/
inman lightdm
and I didn't have either this orlightdm.conf
on my system. So, although I'm sure it probably does work as suggested by Stephen, again, you don't need to do this.So, if it doesn't exist already, something along the lines of the following in
/etc/lightdm/lightdm.conf
(sudo
, obviously) should work just fine:See
man xrandr
for configuration options.BTW: I could probably have got away with comments/edits here but I don't have the rep and I did want to add the sources for this information.
Version
References
man xrandr
man lightdm
16.04
The only fix that works for me is to copy
~/.config/monitors.xml
to/var/lib/lightdm/.config/
, similar to the method in Steve Dee's answer, but with a copy of the file rather than just a symlink to it. Making a symbolic link doesn't work.Neither falconer's nor Stephen Ostermiller's answer worked for me. I just saw the correctly rotated screen for 2 seconds after boot, then it rotated back to horizontal orientation.
I had the same issue with the incorrect greeter screen in Ubuntu 18.04 on a vertical monitor. I tried some of the mentioned
xrandr
commands as indicated in other replies, but these did not work for me. I then followed the reply which advised to copy the~/.config/monitors.xml
file to the/var/lib/gdm3/.config
directory. After rebooting the greeter screen still had the incorrect orientation. My next step was to look to the contents of the/var/lib/gdm3/.config/monitors.xml
file. I noticed that it contained a history of various monitors and configurations which I have used over the years. I edited this file to only contain the setup of the current configuration.The structure of the
monitors.xml
file is that it contains one set of<monitors>
and</monitors>
tags, at the beginning and end of the file. In between these tags are one or more set(s) of<configuration>
and</configuration>
tags. Each of these sections contain one or more set(s) of<logicalmonitor>
and</logicalmonitor>
tags. Each of these sections specify one monitor, with parameters such as brand and type, orientation (if not horizontal), width, height, x, y and refresh rate. It also specifies if a monitor is the primary monitor. In my file was the current setup listed near the bottom of the file. I removed all<configuration> </configuration>
sections which did not describe my current setup. The result looks like this:Now I rebooted my computer. This time the screener window did have the correct orientation. I guess that the history as captured in the original
monitors.xml
file was causing issues.Have you tried
xrandr -o value
? As avalue
use eitherleft
orright
Also you can create a custom shortcut by following this HOW TO
Same question and my results in 18.10:
falconer's answer is good. Let me add 2 details that I had to figure out in 18.10:
[SeatDefaults]
current versions expect[Seat:*]
logger
and thenxmessage
to conclude, that it does get called, it does set things right, but then its effect is unfortunately undone by unity-greeter.I tried other greeters, and they all honor the solution and start up nicely rotated, except the default unity-greeter. I ended up using slick-greeter.