LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 06-26-2021, 08:46 AM   #1
Snugbug
Member
 
Registered: May 2020
Posts: 97

Rep: Reputation: Disabled
Kubuntu 21.04 - How to swap the login screens on a dual monitor system?


I'm running Kubuntu 21.04 as a dual monitor system, where the right monitor is the main one.
This means, when I move the mouse beyond the left edge of the right monitor, the mouse pointer appears on the right edge of the left monitor.

The problem is, this doesn't work for the login screen, where it's vice versa, unfortunately.

Is there any way to swap the monitors for the login screen, too?
 
Old 06-27-2021, 03:51 PM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,813
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
IIRC, configure X in /etc/X11/xorg.con* to make the desired display the primary display. I haven't bothered in a long time, just letting the login screen appear wherever it wants. If you can get xrandr to fire in a script to designate the primary before the greeter launches it should work too. I've never in any Debian derivative found the right place to get xrandr to fire soon enough.

What can for sure work is cable swapping, if not including a laptop or notebook screen among outputs.
 
Old 06-27-2021, 07:47 PM   #3
Snugbug
Member
 
Registered: May 2020
Posts: 97

Original Poster
Rep: Reputation: Disabled
Sorry, swapping the cables is no option because of different connectors in use, and the problem is only affecting the login screen.

Could you or anybody else please give me more details as for how to swap the login screens using software methods?

Here's my xrandr output:

Code:
xrandr
Screen 0: minimum 8 x 8, current 3840 x 1080, maximum 16384 x 16384
DVI-I-0 disconnected (normal left inverted right x axis y axis)
DVI-I-1 disconnected (normal left inverted right x axis y axis)
DP-0 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 598mm x 336mm
   1920x1080     60.00*+
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1152x864      75.00  
   1024x768      75.03    60.00  
   800x600       75.00    60.32  
   640x480       75.00    59.94  
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 287mm
   1920x1080     60.00*+  59.94    50.00    60.00    50.04    50.04  
   1680x1050     59.95  
   1600x1200     60.00  
   1440x900      74.98    59.89  
   1400x1050     59.98  
   1360x768      60.02  
   1280x1024     75.02    60.02  
   1280x960      60.00  
   1280x720      59.94    50.00  
   1152x864      75.00  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94    59.93  
DVI-D-0 disconnected (normal left inverted right x axis y axis)
 
Old 06-28-2021, 01:02 AM   #4
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,813
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
Quote:
Originally Posted by Snugbug View Post
Code:
xrandr
...
DP-0 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 598mm x 336mm
...
HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 287mm...
Given the above:
Code:
xrandr --output HDMI-0 --primary
should move the primary from DP-0 to HDMI-0.

Using /etc/X11/xorg.con* is more complicated, and vexing, to make work. What follows worked for me on Debian Testing (soon to be released as Debian 11/Stable/Bullseye) using an AMD GPU, so, with the modifications below listed, should work in *buntu 21.04 if you are using an AMD GPU:
Code:
# cat /etc/X11/xorg.conf
# 50-device.conf
Section "Device"
        Identifier      "AMD1"
#       Option  "monitor-DP-0"          "DPcon"
        Option  "monitor-DisplayPort-0" "DPcon"
#       Option  "monitor-HDMI-0"        "HDMIcon"
        Option  "monitor-DVI-I-0"       "HDMIcon"
EndSection

# 50-monitor1.conf
Section "Monitor"
        Identifier      "HDMIcon"
        Option          "Primary"       "true"
#       Option          "RightOf"       "DPcon"
        Option  "PreferredMode" "2560x1080"
EndSection

# 50-monitor2.conf
Section "Monitor"
        Identifier      "DPcon"
        Option  "PreferredMode" "2560x1440"
        Option          "LeftOf"        "HDMIcon"
EndSection

# 50-screen1.conf
Section "Screen"
        Identifier      "ScreenRight"
        Device          "AMD1"
        Monitor         "HDMIcon"
EndSection

# 50-screen2.conf
Section "Screen"
        Identifier      "ScreenLeft"
        Device          "AMD1"
        Monitor         "DPcon"
EndSection
# inxi -Sy
System:
  Host: fi965 Kernel: 5.10.0-7-amd64 x86_64 bits: 64 Desktop: Trinity R14.0.11
  Distro: Debian GNU/Linux 11 (bullseye)
# inxi -Gay
Graphics:
  Device-1: AMD Oland [Radeon HD 8570 / R5 430 OEM / R7 240/340 / Radeon 520 OEM]
  vendor: Dell driver: amdgpu v: kernel alternate: radeon bus-ID: 01:00.0
  chip-ID: 1002:6611 class-ID: 0300
  Display: x11 server: X.Org 1.20.11 driver: loaded: amdgpu
  unloaded: fbdev,modesetting,vesa alternate: ati display-ID: :0 screens: 1
  Screen-1: 0 s-res: 5120x1440 s-dpi: 120 s-size: 1083x304mm (42.6x12.0")
  s-diag: 1125mm (44.3")
  Monitor-1: DVI-I-0 res: 2560x1080 hz: 60 dpi: 97
  size: 673x284mm (26.5x11.2") diag: 730mm (28.8")
  Monitor-2: DisplayPort-0 res: 2560x1440 hz: 60 dpi: 109
  size: 598x336mm (23.5x13.2") diag: 686mm (27")
  OpenGL: renderer: AMD Radeon HD 8500 Series (OLAND DRM 3.40.0 5.10.0-7-amd64 LLVM 11.0.1)
  v: 4.6 Mesa 20.3.4 direct render: Yes
# xrandr | egrep 'onnect|creen|\*' | grep -v disconn | sort -r
Screen 0: minimum 320 x 200, current 5120 x 1440, maximum 16384 x 16384
DVI-I-0 connected primary 2560x1080+2560+0 (normal left inverted right x axis y axis) 673mm x 284mm
DisplayPort-0 connected 2560x1440+0+0 (normal left inverted right x axis y axis) 598mm x 336mm
  2560x1440     59.95*+  74.92
  2560x1080     60.00*+
#
You're output names are different from mine, so you would need to, or may want to:
  • Because I have different output names to work with (DVI-I-0 is actually an HDMI connection at the display), in Section "Device", you need to remove or comment the two xorg.conf lines below the commented "Option" lines, and remove the comment marks (#) from the other two option lines
  • Need to either adjust to your own displays' resolutions, or remove, the two "PreferredMode" lines that I needed to get my own normally primary larger display to not fall back to a lesser supported mode than the now configured primary display. If both your displays use the same resolution (mode), most likely you will not need any "PreferredMode" lines.
  • You may safely discard the commented lines preceding each Section line.
  • You may instead of using xorg.conf as I did, break my file into 3 files using the names that are comments above each section line, placed into /etc/X11/xorg.conf.d/

If you are not using an AMD GPU, please provide input/output from either or both of the following:
Code:
lspci -nnk | grep -iA3 VGA
inxi -GSa
 
Old 06-28-2021, 04:19 AM   #5
Snugbug
Member
 
Registered: May 2020
Posts: 97

Original Poster
Rep: Reputation: Disabled
There's no /etc/X11/xorg.con* on my Kubuntu, only this empty folder:
/etc/X11/xorg.conf.d

My GPU is an Nvidia.
DP-0 is my main monitor (27''), right at front of me and HDMI-0 (23'') is the 2nd one, located on the left side.
If I make HDMI-0 primary, everything is on the left monitor, which isn't what I'm looking for.
I'm afraid, moving the 27'' (currently DP-0) to the left side and the 23'' (currently HDMI-0) in front of me is no option because of the prevailing spatial conditions and because I would prefer keeping the 27'' to be the main one.

Here's the wanted data:

Code:
lspci -nnk | grep -iA3 VGA
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GM206 [GeForce GTX 960] [10de:1401] (rev a1)
        Subsystem: NVIDIA Corporation GM206 [GeForce GTX 960] [10de:1401]
        Kernel driver in use: nvidia
        Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
Code:
inxi -GSa
System:    Host: [username] Kernel: 5.11.0-22-generic x86_64 bits: 64 compiler: gcc v: 10.2.1 
           parameters: BOOT_IMAGE=/boot/vmlinuz-5.11.0-22-generic root=UUID=c92ac852-1573-4369-9574-e2afc9a0859e ro quiet 
           splash 
           Desktop: KDE Plasma 5.21.4 tk: Qt 5.15.2 wm: kwin_x11 dm: SDDM Distro: Ubuntu 21.04 (Hirsute Hippo) 
Graphics:  Device-1: NVIDIA GM206 [GeForce GTX 960] driver: nvidia v: 465.27 alternate: nvidiafb,nouveau,nvidia_drm 
           bus ID: 01:00.0 chip ID: 10de:1401 class ID: 0300 
           Device-2: TerraTec Electronic Video Grabber type: USB driver: cx231xx bus ID: 1-3.3:8 chip ID: 0ccd:00a6 
           class ID: ef00 serial: 0000000000 
           Display: x11 server: X.Org 1.20.11 compositor: kwin_x11 driver: loaded: nvidia 
           unloaded: fbdev,modesetting,nouveau,vesa display ID: :0 screens: 1 
           Screen-1: 0 s-res: 3840x1080 s-dpi: 81 s-size: 1204x343mm (47.4x13.5") s-diag: 1252mm (49.3") 
           Monitor-1: DP-0 res: 1920x1080 hz: 60 dpi: 82 size: 598x336mm (23.5x13.2") diag: 686mm (27") 
           Monitor-2: HDMI-0 res: 1920x1080 hz: 60 dpi: 96 size: 510x287mm (20.1x11.3") diag: 585mm (23") 
           OpenGL: renderer: NVIDIA GeForce GTX 960/PCIe/SSE2 v: 4.6.0 NVIDIA 465.27 direct render: Yes
 
Old 06-28-2021, 10:41 PM   #6
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,813
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
Quote:
Originally Posted by Snugbug View Post
There's no /etc/X11/xorg.con* on my Kubuntu, only this empty folder:
/etc/X11/xorg.conf.d
/etc/X11/xorg.conf is an optional configuration file. /etc/X11/xorg.conf.d/ is an optional directory. You may place a single configuration file as /etc/X11/xorg.conf, or any files of the form *.conf in /etc/X11/xorg.conf.d/, and if valid for the available GPU and drivers, they will be utilized. Getting desired results generally takes trial and error.

Quote:
My GPU is an Nvidia.
This need not stop you from trying my xorg.conf file with it modified as I instructed. You may or may not need to add a 'Section "ServerLayout"' to have it work right.

I'm not in position to install NVidia's own drivers in order to try to perfect an xorg.conf file fully expected to work as you desire. They tend to have unique characteristics in some cases from FOSS drivers. I'm guessing what you wish is achievable, either through experimentation and reading the xorg.conf man page and/or other documentation, or by finding someone with expertise in the use of NVidia's own drivers. The latter may require visiting NVidia's own help forum.

What you're after is not *buntu- or version-specific. You might find better help here by asking a mod to move this to the Desktop forum.
 
Old 06-29-2021, 07:07 AM   #7
Snugbug
Member
 
Registered: May 2020
Posts: 97

Original Poster
Rep: Reputation: Disabled
Now, it became even worse. The entire system seems to be ruined, even before trying anything with your xorg.conf file.
The whole taskbar has moved to the top edge of the desktop, without any chance to move it back to the lower edge again, because the settings open at the top of that bar where they off screen and therefore unreachable and when I tray to open the start menu it is partly shifted off screen, so I cannot reach almost nothing of that menu. I don't know what (or why it) happened.
Just suddenly, everything was ruined.

I've got no idea how to restore this mess into something usable again.

EDIT:
Guess it is something about KDE, because I also tried an MX 19.4 KDE, where almost the same happened.
Not sure if it is about the kernel (I used a 5.12.x for Kubuntu and 5.8.x for MX) or the graphics driver (I tried an Nvidia 465.27 on Kubuntu and MX, but on MX it even happened with the Nouveau driver).

Seems like I can forget about KDE, because my computer doesn't like it at all.

Last edited by Snugbug; 06-29-2021 at 07:15 AM.
 
Old 06-29-2021, 11:18 AM   #8
lovemeslk
Member
 
Registered: Feb 2020
Location: Rantoul IL
Distribution: Slackware
Posts: 350

Rep: Reputation: 72
In kubuntu 21.04 and using the default wayland xwayland etc. this can be done from system setting display.
if it does not show both displays then something is wrong.
If using the NVidia driver full install. Open the nvidia-setings program select your primary Display. and save it.
it creates a ~/.nvidia-settings-rc and when you reboot it will will work.
You need to Handel that with nvidia.
if you have a laptop that runs the APU and the Nvidia.
Make sure Nvidia is capturing both displays in nvidia-settings.
Also look at System-settings display.
 
Old 06-30-2021, 03:26 AM   #9
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,813
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
Quote:
Originally Posted by Snugbug View Post
Guess it is something about KDE, because I also tried an MX 19.4 KDE, where almost the same happened.
Not sure if it is about the kernel (I used a 5.12.x for Kubuntu and 5.8.x for MX) or the graphics driver (I tried an Nvidia 465.27 on Kubuntu and MX, but on MX it even happened with the Nouveau driver).

Seems like I can forget about KDE, because my computer doesn't like it at all.
When things get crazy in KDE, log out of it, log in on a vtty, and delete ~/.cache/*, then try KDE again.

Did you ever give the default X driver[1] a chance. It's the only driver I use with my NVidia GPUs. To use it, uninstall NVidia's drivers and xserver-xorg-video-nouveau, and see what happens (without any /etc/X11/xorg*.conf files).

One other thing, besides cache corruption, likely to cause "entire system seems to be ruined" is Kscreen2 might be fighting against your attempts to influence the display through config files or xrandr or arandr. You can disable it in background services in systemsettings.

[1] named modesetting, provided by the xserver package, so you can't get rid of it. More info here.
 
Old 07-01-2021, 05:09 AM   #10
Snugbug
Member
 
Registered: May 2020
Posts: 97

Original Poster
Rep: Reputation: Disabled
I reinstalled everything from scratch and tried version 460 of the Nvidia drivers. It's the tested one according to the driver manager of Kubuntu. I also saved the settings from within the Nvidia X Server Settings as you told me (@ mrmazda). This seems to have been the crucial step, because even after two days with this installation, everything is still working fine, without any shifted windows, workspaces and the start menu is still where it's supposed to be, too.
I guess, I can now begin to install all of my apps and tools, which I used to have in previous installations (i.e. Mint, Bodhi, MX,... ).

Everybody, thank you very much for your support!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual monitors: swap "monitor 0" and "monitor 1"? hamiltc Ubuntu 1 02-12-2011 12:12 PM
How to use the dual monitor in 'Multiple X Screens' ronaldv Linux - Networking 4 03-14-2008 05:12 PM
Managing multiple screens: redirecting video output and switching between screens simopal6 Linux - Hardware 2 11-13-2007 06:08 AM
Dual monitor as individual screens linuxmandrake SUSE / openSUSE 0 09-28-2007 03:49 PM
Firefox on two screens (dual monitor setup) RemusX2 Linux - Software 2 10-01-2006 12:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 09:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration