Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move settings to xprofile and don't overwrite existing settings. #182

Merged
merged 11 commits into from Jan 8, 2021

Conversation

jacobgkau
Copy link
Member

Fixes #179.

While placing this command in /etc/profile.d did not impact the ability to use multiple displays, it did cause the display configuration to be lost if /etc/profile is re-run after login, and caused error messages when logging in remotely. This PR makes the following changes:

  • Remove the command from /etc/profile.d.
  • Add the command instead to /etc/xprofile, which is only run at graphical login by GDM and other display managers.
    • /etc/xprofile.d does not exist by default, nor does /etc/xprofile. Using /etc/xprofile.d would still require creating /etc/xprofile first, so it's simpler not to use it.
  • The script will now check for CurrentMetaMode and will append ForceFullCompositionPipeline onto the existing CurrentMetaMode so as not to overwrite existing display settings. Only if CurrentMetaMode doesn't exist is the default nvidia-auto-select option used.

I'm testing thoroughly and will un-mark as draft when this is ready for full review.

@jacobgkau
Copy link
Member Author

Tested the following scenarios on Pop 20.10 and Ubuntu 20.04:

  • Installing/updating/reconfiguring system76-driver:

    • If s76-nvidia-fullcomp.sh exists and xprofile does not exist (current up-to-date machines), s76-nvidia-fullcomp.sh is removed and xprofile is created with the correct contents.
    • If s76-nvidia-fullcomp.sh does not exist and xprofile exists with the required contents, no action is taken.
    • If s76-nvidia-fullcomp.sh exists and xprofile exists with the required contents, s76-nvidia-fullcomp.sh is removed but xprofile is not modified.
    • If xprofile exists but does not contain the required contents, the contents are added (but prior contents is preserved.)
    • If neither s76-nvidia-fullcomp.sh nor /etc/xprofile exist (e.g. a fresh Ubuntu install), /etc/xprofile is added with the correct contents.
  • After the action has been run:

    • ForceFullCompositionPipeline is enabled successfully on boot/login (seen in nvidia-settings and by the lack of stuttering.)
    • Displays can be added, removed, and rearranged.
    • The system can be booted with one or multiple displays.
    • Logging into an interactive root shell with sudo -i does not flicker the screen or reset display settings.
    • Logging into a TTY does not display an error message from nvidia-settings.
    • Logging in via SSH does not display an error message from nvidia-settings.
    • Logging in via SSH with X11 forwarding does not attempt to run nvidia-settings on the SSH client.

(For the record, I also double-checked that ForceFullCompositionPipeline is still needed before making this PR, and it is still needed on this machine.)

@jacobgkau jacobgkau marked this pull request as ready for review January 5, 2021 22:12
@jacobgkau jacobgkau requested review from a team January 5, 2021 22:12
system76driver/actions.py Outdated Show resolved Hide resolved
system76driver/actions.py Outdated Show resolved Hide resolved
@jacobgkau
Copy link
Member Author

Confirmed the xprofile script still works as intended with one or multiple displays, and all of the test cases from my previous comment still work, with the latest changes on 0642ef8.

@jackpot51 jackpot51 merged commit 37ce79f into master Jan 8, 2021
@jackpot51 jackpot51 deleted the serw12-preserve-displays branch January 8, 2021 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Primary display is disabled with multiple monitors
4 participants