Dual Screen Orientation on Boot

Suggestions and feedback for Linux Mint and the forums
Forum rules
Do not post support questions here. Before you post read: Where to post ideas & feature requests
Post Reply
weddi_eddy
Level 1
Level 1
Posts: 1
Joined: Sat Feb 20, 2021 8:46 pm

Dual Screen Orientation on Boot

Post by weddi_eddy »

Hello. Logically, I think this suggestion belongs here as it appears to be design rather than a bug or issue.

Let me explain what I see:
When I power on my laptop (on my right), the login screen for Linux Mint (Cinnamon) appears. I have a monitor to the left of it. Linux Mint appears on both monitors. Typically I would drag my mouse from right to left (laptop to monitor) but that's not the case. I have to drag my mouse right to right (which shows up on my left monitor's left side). Think of the cursor wrapping around.

I know that if this was the first time I've connected this, then disorientation might make sense because my laptop doesn't know where the second (or third) monitor is. The thing is, I've already went into display settings and set the correct orientation. Once I log in, the orientation sets correctly as was configured.

It's not annoying enough to ask the support section to assist, but I figured we could improve the logic on a future build.

Here's the suggestion:

If Linux Mint can remember that an orientation is set, that means it's stored somewhere. If that's the case, then couldn't the login screen be coded to also read that configuration(s) if monitors are set when building the login screen and on boot?

Does this make sense?
t42
Level 11
Level 11
Posts: 3734
Joined: Mon Jan 20, 2014 6:48 pm

Re: Dual Screen Orientation on Boot

Post by t42 »

weddi_eddy wrote: Sat Feb 20, 2021 9:07 pm
I know that if this was the first time I've connected this, then disorientation might make sense because my laptop doesn't know where the second (or third) monitor is. The thing is, I've already went into display settings and set the correct orientation. Once I log in, the orientation sets correctly as was configured.
It's ruled by different systems so "the laptop doesn't know". You can do all that this way:
- Start arandr and save screens state. (you can use xrandr too if you are comfortable with it)
- Add the result to /etc/lightdm/lightdm.conf
- Reboot

Here is a sample of /etc/lightdm/lightdm.conf for two monitors

Code: Select all

[Seat:*]
display-setup-script=xrandr --output DVI-D-0 --primary --mode 1280x1024 --pos 0x0 --rotate left --output HDMI-0 --mode 1680x1050 --pos 1024x0 --rotate normal


-=t42=-
User avatar
AndyMH
Level 21
Level 21
Posts: 13728
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Dual Screen Orientation on Boot

Post by AndyMH »

You might want to wrap that script in an if clause to test if the external monitor is present. It's what I do to set the resolution on my ultrawide when connected to the laptop. If no test and no external monitor you may end up in a loop and no boot to the GUI - I know I've done it.
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
t42
Level 11
Level 11
Posts: 3734
Joined: Mon Jan 20, 2014 6:48 pm

Re: Dual Screen Orientation on Boot

Post by t42 »

AndyMH wrote: Mon Feb 22, 2021 6:09 am You might want to wrap that script in an if clause to test if the external monitor is present. It's what I do to set the resolution on my ultrawide when connected to the laptop. If no test and no external monitor you may end up in a loop and no boot to the GUI - I know I've done it.
It's very interesting warning. I never had such problem on dozen setups. Here is a successful session, just for test, on my LM20 Cinnamon system based on the external USB HDD. Moved from its configured two-monitor system to the random Lenovo notebook with very different hardware. It seems that lightdm did nice job with /dev/null:

Code: Select all

     Active: active (running) since Mon 2021-02-22 12:46:36 EET; 1min 35s ago
       Docs: man:lightdm(1)
    Process: 829 ExecStartPre=/bin/sh -c [ "$(basename $(cat /etc/X11/default-display-manager 2>/dev/null))" = "lightdm" ] (code=exited, status=0/SUCCESS)
   Main PID: 835 (lightdm)
      Tasks: 24 (limit: 9322)
     Memory: 150.2M
     CGroup: /system.slice/lightdm.service
             ├─835 /usr/sbin/lightdm
             └─881 /usr/lib/xorg/Xorg -core :0 -seat seat0 -auth /var/run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch

Feb 22 12:46:49 vlm20 lightdm[969]: warning: output DVI-D-0 not found; ignoring
Feb 22 12:46:49 vlm20 lightdm[969]: warning: output HDMI-0 not found; ignoring
Feb 22 12:46:49 vlm20 lightdm[971]: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
-=t42=-
User avatar
Burning Desires 69
Level 2
Level 2
Posts: 93
Joined: Mon Feb 15, 2021 6:30 pm
Location: Your Backyard!
Contact:

Re: Dual Screen Orientation on Boot

Post by Burning Desires 69 »

Just curious, but would this help at all? This is how mine is setup, & I haven't had any issues.

Appearance
----------------

My Background (2 Monitors Wide)
Background Color (My Color)
Stretch background across multiple Monitors [J]

Users
--------
I Didn't Use This At All.

Settings
-----------

HiDPI Support [Auto] ;"This Was On [Auto] By Default, I Just Left It Alone"
Monitor [Laptop Monitor] ;"I Would Have Chosen This, It Might Prevent Your Wrap Around Issues"
(I Left my "Monitor" On [Auto] ;"Since My Log-In Jumps Back & Forth")

I left all 6 bottom things Checked by Default.

---------------------------------------------------------

Did this solve your issues?
I Loved World = 80's & 90's
World Hates Me = 2016 to 2019
I Hate World = 2020 & ^
They want us to Suffer, then lets speed it up, just burn our Sanity away. Else, Shut It!
A "Scar" Means? Yur About To Find Out, The Hard Way!
Kendoori
Level 5
Level 5
Posts: 748
Joined: Thu Jul 09, 2009 12:51 pm
Location: Sanibel, FL USA

Re: Dual Screen Orientation on Boot

Post by Kendoori »

AndyMH wrote: Mon Feb 22, 2021 6:09 am You might want to wrap that script in an if clause to test if the external monitor is present. It's what I do to set the resolution on my ultrawide when connected to the laptop. If no test and no external monitor you may end up in a loop and no boot to the GUI - I know I've done it.
@AndyMH, can you post your script? I've used AutoRandR but it's ignoring my preference for my 2nd screen. I have bound the ARandR state I prefer bound do a keyboard shortcut, but would prefer to have this automated.
User avatar
AndyMH
Level 21
Level 21
Posts: 13728
Joined: Fri Mar 04, 2016 5:23 pm
Location: Wiltshire

Re: Dual Screen Orientation on Boot

Post by AndyMH »

Very simple, script lives at /usr/bin/LGmonitor.bsh containing:

Code: Select all

#!/bin/bash
if xrandr | grep -q "HDMI-2 connected"; then
    xrandr --newmode "2560x1080" 185.58 2560 2624 2688 2784 1080 1083 1093 1111 -hsync -vsync
    xrandr --addmode HDMI-2 "2560x1080"
    xrandr --output HDMI-2 --mode "2560x1080"
fi
checks to see if the monitor is connected before setting the mode. I need it because this is an external monitor plugged into a laptop and also want to use the laptop 'standalone'. Now if you have more than one monitor and could connect either to the same port, you'd be in trouble, but I only have one monitor.

I suppose in this new world of usrmerge, the shebang should be #!/usr/bin/bash :)

And /etc/lightdm/lightdm.conf.d/71-linuxmint.conf contains:

Code: Select all

[SeatDefaults]
user-session=cinnamon
display-setup-script=/usr/bin/LGmonitor.bsh
Thinkcentre M720Q - LM21.3 cinnamon, 4 x T430 - LM21.3 cinnamon, Homebrew desktop i5-8400+GTX1080 Cinnamon 19.0
Post Reply

Return to “Suggestions & Feedback”