I'm new to Linux (Ubuntu 20.04 LTS) and I'm having troubles with my monitor setup. Assume for the rest of this post that when I write USER I mean the username I chose during installation (my username is my real name, so...).
I installed the proprietary nVidia driver I needed, and so far seems fine (the games I've tried work), except that my dual monitor setup doesn't save between boots. I have one in landscape in the center, and one in portrait mode to my right.
On startup, Ubuntu thinks my right monitor is landscape, so my mouse moves down instead of right, and all my windows are sideways. I used nVidia X Server Settings to change the settings and it would work but not save between boots. I've tried 'Save to X Configuration File' in two places,
/etc/X11/Xsession.d/xorg.conf, and neither allow the monitor settings to persist after reboot. I always end up with my right monitor thinking it should be in landscape mode.
I also tried to apply the nVidia settings, then go and change something in Ubuntu's Settings->Display then apply that, and then save to xconfig in NVidia, but it didn't work and I got another problem instead.
The problem I got is the same problem as this user on reddit here, including my monitors looking like theirs did in the screenshots they provide, where their portrait-monitor wasn't used and their main monitor was extra stretched. I followed the directions in the comment chosen as the solution (used arandr to save a .sh, then added it to the Startup preferences), and it works just fine getting my monitors to display correctly, but it also doesn't persist between startups.
Because it's easier than messing with nVidia settings every time, I now just load the .sh file in arandr when I boot up.
Next reboot, I opened Startup Applications Preferences and the new entry I'd added to save my monitor settings wasn't there at all.
So I tried following the directions of the answer on this post here (
sudo chown -R [username]:[username] ~/.config and
gnome-session-properties; I replaced
USER:USER because that's what I assumed it meant). I actually tried the second solution first, and it didn't make a difference, so I tried doing the first command and the second but instead of
gnome-session-properties I tried
sudo gnome-session-properties and then rebooted. Same problem as before - settings didn't change, side monitor thinks it's landscape.
Through some testing I found that if I open Startup Applications Preferences through the menu or the command
gnome-session-properties the added command isn't there, but if I open the program through
sudo gnome-session-properties the startup command I added is there. Why is that, and how do I get it to actually do something?
Also, when I open Startup Applications Preferences from terminal with just
gnome-session-properties and add the desired setting, the terminal gives me:
** (gnome-session-properties:3523): WARNING **: 20:40:59.259: Could not save /home/USER/.config/autostart/sideportrait.sh.desktop file
Despite giving this warning, the startup program looks like it's there before I close it, but when I reopen it, the added setting is gone.
I looked at my files and found that in .config there isn't a folder called autostart - it's a text file, and in the text file the only thing is some stuff about Discord (which also doesn't actually run on startup), despite there being three things in Startup Applications Preferences that are always there - I just don't see them in the autostart file. What's going on here? I've got hidden files visible according to the Files settings, but I don't see an autostart folder.
How do I fix this? I'll run the arandr file every time I reboot if I have to, but I'd rather not.