0

I tried several methods from several forums but nothing worked for me. I want my display to come in portrait mode after boot.

After login if I manually rotate screen from terminal by command xrandr -o left it will rotating fine. But I am wondering in which file should I add this command so that my screen becomes portrait for permanent.

Liso
  • 15,377
  • 3
  • 51
  • 80

1 Answers1

1

Add following to startup application :

/bin/bash -c "sleep 15&&xrandr -o left"

The reason adding 15 second of break to prevent xrandr command performed too early, which cause desktop to break while the desktop is still loading. @Jacob Vlijm explain why this is necessary.

enter image description here

Apply change to LightDM

Open your favourite text editor, I'll use gedit for example. With root privileges, because we're gonna modify system directory.

gksudo gedit /etc/lightdm/lightdm.conf

Add following entries to opened gedit.

[SeatDefaults]
display-setup-script=xrandr -o left

Save the file then.

WARNING: Haven't tested, because it's not something I want to (have to un-)do on my machine. If the X failed to start, use recovery mode to remove the file.

Liso
  • 15,377
  • 3
  • 51
  • 80
  • it works but the screen rotates only after login. Is there a way to make login screen also portrait. – Sanjeev Kumar Dec 05 '16 at 06:15
  • @SanjeevKumar Edited – Liso Dec 05 '16 at 07:14
  • Thanks for your support. Both of your suggestions are working but still I am facing an undesired behavior. This lightdm.conf change makes the login screen portrait mode. But when I press enter on login the screen changes back to landscape. Now After 15 seconds of login the screen again changes to portrait mode(because of start up application change). Is it possible to avoid the transition from portrait to landscape on login? – Sanjeev Kumar Dec 05 '16 at 17:50
  • @SanjeevKumar I believe you need a little tweak on sleep 15 to see what is needed. – Liso Dec 07 '16 at 02:37