Closed ztibeike closed 3 years ago
@ztibeike
First, I should clarify that this is not an issue with my script, but it is a GDM3 issue because it was not developed with customization in mind. In fact, this problem is the exact reason I created the script.
Gnome Display Manager 3 uses the default gnome multi-screen configuration which is to join displays, but instead of copying the whole main screen background image as gnome session does, it stretches the image as if both monitors were one screen.
I don't have another monitor to create this environment, but I successfully managed to apply other muti-screen layouts to gdm3 in a virtual machine using virtual box, although I wasn't able to achieve what you asked which is to copy the background image to the other display without mirroring the screen.
You can apply a different default layout to GDM by selecting the desired configuration in the Displays menu, which could be either Single Display, Mirror or Join Display and then by copying the monitors.xml
file in ~/.config/
to the ~gdm/.config/
folder.
After that, gdm will apply the user configuration instead of the default one, even if you change your user configuration again later.
Thanks for your help. By the way, where's the ~gdm/.config/ located? It's a wrong path. Do you mean ~/.gdm/.config or ~/gdm/.config?
I got it. it turns out to be the home dir of gdm user. I've already solved this problem. Thanks a lot.
It Worked! Awesome work @thiggy01
I just wanted to share an alternative method that also worked for me, and in my opinion is easier: just use a photo editor (I used GIMP) and copy whatever picture you want to use side-by-side. When it stretches it will look normal like it's duplicated. You can even have the monitors have different backgrounds (see pic). I'm not sure how well it will work with different res monitors, but if yours are the same resolution, it's another option.
@ztibeike @thiggy01 I cant find the ~gdm/.config/ folder and I don't understand what you mean by "home directory of the gdm user"... Is it possible that the location changed with Ubuntu 21.04? Please help. Thanks!
Thank you @paulhutchings for your method. It also works for monitors with different resolutions. Just use pictures with the corresponding resolutions and a program like gimp to join them. I my case: my left monitor has a resolution of 2560 and the right one 1920x1080. In gimp I made a new page with a resolution of 4480x1440. I pasted the two pictures next to each other. The picture for the right monitor goes in the top left corner, the picture for the left monitor goes in the top right corner. Because the left picture is smaller and does not fill the whole height, there is a white area below the left picture, which is not visible when logging in.
@PhiCecHey
for everyone who finds this issue in the future, just run the command below after the layout is applied correctly
sudo cp ~/.config/monitors.xml `grep gdm /etc/passwd | awk -F ":" '{print $6}'`/.config/
To be clear, this part of the command show the path of the home directory of the gdm user
grep gdm /etc/passwd | awk -F ":" '{print $6}'
Please add support to multi-screen. It supposed to copy the main screen's background image to the secondary screen instead of stretch the image.