Page MenuHomeSolus

Make lightdm source .profile and .xprofile. Resolves T8859.
ClosedPublic

Authored by xulongwu4 on Jun 3 2020, 6:22 PM.
Tags
None
Referenced Files
F10995274: D8984.id21639.diff
Wed, Jul 26, 3:46 AM
F10964606: D8984.id.diff
Wed, Jul 19, 12:47 PM
F10913455: D8984.id21639.diff
Jul 7 2023, 10:03 PM
F10897303: D8984.diff
Jul 2 2023, 5:44 AM
F10878712: D8984.id22035.diff
Jun 21 2023, 1:01 PM
F10878431: D8984.id22349.diff
Jun 21 2023, 9:05 AM
F10877672: D8984.id21625.diff
Jun 20 2023, 9:45 PM
F10874031: D8984.id21639.diff
Jun 19 2023, 9:37 PM

Details

Summary

Added code to lightdm-wrapper to make it source profile, .xprofile, .Xresources, and scripts in /etc/X11/xinit/xintrc.d before staring an xsession. Now these files will be sourced by all three display managers in Solus repo: gdm, sddm, and lightdm.

Test Plan

Installed this version on both Budgie and MATE version. They both pick up environment variable definitions in my .profile

Diff Detail

Repository
R1955 lightdm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

xulongwu4 retitled this revision from Make lightdm source .profile and .xprofile to Make lightdm source .profile and .xprofile. Resolves T8859, T610..Jun 3 2020, 6:23 PM
xulongwu4 added a subscriber: ermo.
xulongwu4 added a subscriber: Schteve.

In response to @ermo's comment in D8678 about setting up the same procedure for other Xsessions, I confirmed that .profile and .xprofile is automatically picked up by gdm and sddm so no changes are needed for those two.

ermo requested changes to this revision.EditedJun 3 2020, 8:18 PM

In response to @ermo's comment in D8678 about setting up the same procedure for other Xsessions, I confirmed that .profile and .xprofile is automatically picked up by gdm and sddm so no changes are needed for those two.

Did you test .Xmodmap and .Xresources in the GNOME (gdm) and KDE (sddm) spins?

I'm happy to endorse this, but I'd prefer if we had the exact same behaviour across all four DEs in the presence of local configuration files (and if we can't have that, at least document why according to upstream).

Would you be willing to open a task and drive the testing of this and reference necessary patches in that task (including this one)?

I realise that this can seem like an exercise in moving the goalposts -- please bear with me as I honestly think following the principle of least astonishment here is a good thing in this area.

This revision now requires changes to proceed.Jun 3 2020, 8:18 PM

@ermo Yeah I actually looked into the xsession startup script shiped with gdm and sddm. They both source .Xresources along with .profile and .xprofile. lightdm-wrapper will do the same if this patch gets merged.

.Xmodmap is a bit more complicated. sddm does not load it by default. gdm loads it, however, similar to what happend to budgie, gnome-session actually overwrites keymaps later so all changes in .Xmodmap will be lost. In short, .Xmodmap will take effect in MATE. For the other three desktop environments, there are workarounds. sddm users can add xmodmap ~.Xmodmap to ~/.xprofile as that file gets picked up by sddm and that is also a standard file for stuff like setting keyboard and Xresources. For budgie and gnome users, they need to create an autostart script for loading Xmodmap after gnome-session starts.

I think this is the best we can do, as different display managers have different defaults and also work differently. I guess it is reasonable to assume that user of a specific DM will have some knowledge of that DM if they want to do something like setting their own key maps.

ermo requested changes to this revision.Jun 3 2020, 9:19 PM

See T9049#172076 for my notes.

This revision now requires changes to proceed.Jun 3 2020, 9:19 PM

Remove code which sources key maps and xsessions. Only source .profile, .xprofile and .Xresources.

xulongwu4 edited the test plan for this revision. (Show Details)
xulongwu4 edited the summary of this revision. (Show Details)
xulongwu4 edited the summary of this revision. (Show Details)
xulongwu4 retitled this revision from Make lightdm source .profile and .xprofile. Resolves T8859, T610. to Make lightdm source .profile and .xprofile. Resolves T8859..Jun 4 2020, 10:31 PM
JoshStrobl added a subscriber: JoshStrobl.
JoshStrobl added inline comments.
files/lightdm-wrapper
8

Why are we no longer loading our vendor-provided config. That is a violation of statelessness. Is it because you symlinked the /etc/profile in the other patch (which we should not be doing)?

This revision now requires changes to proceed.Jun 20 2020, 3:07 PM
files/lightdm-wrapper
8

The vendor-provided config (/usr/share/defaults/etc/profile is still sourced here since /etc/profile is a symlink to it and is sourced here. I didn't create the symlink /etc/profile. It is created by the bash package. I created the symlink /etc/xprofile in the other patch to mimic the relations between /etc/profile and /usr/share/defaults/etc/profile.

I guess we can modify the patch to source "/usr/share/defaults/etc/profile" and "/usr/share/defaults/etc/xprofile" directly instead of doing a symlink in /etc.

files/lightdm-wrapper
8

I guess we can modify the patch to source "/usr/share/defaults/etc/profile" and "/usr/share/defaults/etc/xprofile" directly instead of doing a symlink in /etc.

That would be a more ideal usecase. I'll admit bash isn't fully in spec.

xulongwu4 added inline comments.
files/lightdm-wrapper
8

@JoshStrobl I replied in D8989 about sourcing /etc/xprofile instead of /usr/share/defaults/etc/xprofile. This is to make lightdm behave the same way as gdm and sddm. The latter two look for /etc/xprofile by default.

Make lightdm source /usr/share/defaults/etc/xprofile for a stateless setup.

xulongwu4 marked 2 inline comments as done.EditedJun 25 2020, 9:15 PM

@JoshStrobl I made lightdm source the vendor-provided xprofile and removed the symlink of /etc/xprofile to /usr/share/defaults/etc/xprofile in D8989 for a stateless setup.

Kindly poking @JoshStrobl for any feedback on this patch.

LGTM, I'll get gdm and sddm patched tomorrow and get this stuff landed. Nice work all around!

This revision is now accepted and ready to land.Jul 15 2020, 12:39 PM

Just a heads up, I'm going to be deferring the landing of this until sometime this weekend. I'll still patch GDM and SDDM in preparation, but I'm not confident there will be enough community testing between landing and sync tomorrow, and I wouldn't want to risk potentially breaking login capabilities.