fairyglade / ly

display manager with console UI
Do What The F*ck You Want To Public License
5.08k stars 306 forks source link

$HOME/.Xresources were not being loaded #600

Open holisticode opened 3 months ago

holisticode commented 3 months ago

I have an old laptop which I wanted to install something lightweight on, but no rolling release (because I don't use it much).

I settled for minimal debian, then i3 on top. As a display manager I choose ly. As terminal I selected urxvt.

I styled `urxvt in the $HOME/.Xresources file, but on login, it was never loaded. But when I ran xrdb merge ~/.Xresources it was being picked. Using a .xinitrc also was not working.

After manually debugging by running /etc/ly/xsetup.sh I could see that the script was failing with has_option from the XSession scripts was not being found. I went down the rabbit hole and discovered that xsetup.sh does not run Xsession, only everything in the subfolders of /etc/X11/Xsession.d. So I made a custom 10-custom-xsession file in that dir with the has_option function. This improved, but still my settings were not loaded.

Finally I moved the whole section

if [ -d /etc/X11/Xresources]; then
...

from the xsetup.sh file, which actually contains the xrdb merge call, above the "Load Xsession scripts" section.

This now worked. However, it feels pretty much a hack. Can I do this differently?

AnErrupTion commented 2 months ago

I went down the rabbit hole and discovered that xsetup.sh does not run Xsession, only everything in the subfolders of /etc/X11/Xsession.d.

It only seems to source it after trying to merge the resources, perhaps that's the sole reason for this issue.

Finally I moved the whole section from the xsetup.sh file, which actually contains the xrdb merge call, above the "Load Xsession scripts" section.

Did you try removing the custom 10-custom-xsession file afterwards to see if it works? If it doesn't, perhaps the other files (namely OPTIONFILE, USERXSESSIONRC and ALTUSERXSESSION) need to be sourced as well, given that they're just set and forgotten later right now.

My guess here is that this condition:

if [ -f "$USERXSESSION" ]; then
  . "$USERXSESSION"
fi

needs to be moved above, right before the script deals with the Xresources files.