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

bash profile not loaded when sway started from a login manager #174

Open
knezi opened this issue Oct 13, 2024 · 5 comments
Open

bash profile not loaded when sway started from a login manager #174

knezi opened this issue Oct 13, 2024 · 5 comments

Comments

@knezi
Copy link

knezi commented Oct 13, 2024

I have a few files in /etc/profile.d/ that set things like environment variables, but these files are not loaded, because sway is started in a non-login shell. In both Gnome and KDE, profile files get loaded and I think it's expected to load these files (some of my packages need them to run), so I think it'd be reasonable to load them in sway too.

Easy fix for this is to change the first line of sway-run.sh to:

#!/bin/sh --login

Do we want this?

@FilippoBonazziSUSE
Copy link
Collaborator

We have not looked deep into cross-DE behaviour, mostly because we really only run openSUSEway and not other environments. However, standards are standards, and we have taken measures to comply where possible (e.g. #77 and #82).

Let me look into this.

If what you want are user-specific variables, instead, I recommend to use ~/.config/environment.d/ as detailed in #77.

@knezi
Copy link
Author

knezi commented Oct 15, 2024

My LEAP 15.6 has 61 files in /etc/profile.d, they set aliases, variables, functions and are part of standard repo packages (for instance aaa_base - installed by default on all installation, flatpak, pulseaudio).

The same holds for my fedora installation, so that leads me to think that it's quite standard to load these files. Especially, sway is expected to be run from tty where this gets loaded, so it's only the display manager route that omits this behaviour.

I've tried searching if it's standardized somewhere (like freedesktop specification), but didn't find anything. That's why I mention how others do it. That being said, I can't say it's the correct way to do this, it's just very easy fix (I did it on machine, so opened this issue for others) and I don't see how that would break anything. Hence the suggestion.

@FilippoBonazziSUSE
Copy link
Collaborator

Sorry, this kinda got left behind. I tried testing this and the files are loaded for me. Maybe I'm testing wrong. Are the default files (flatpak, pulseaudio, ...) loaded for you, and some custom ones of yours are not? Can you share one concrete example with instructions to reproduce (how you observe some file not to be loaded etc)?

@knezi
Copy link
Author

knezi commented Feb 16, 2025

Actually, it seems to be a bit more complicated.
On my LEAP 15.6, I have a file /etc/profile.d/pulseaudio.sh which amongst other things defines $AUDIODRIVER.
This variable is unset. On LEAP with KDE, it gets loaded.
However, I've tested it in VM on tumbleweed and this variable is correctly set even in openSUSEway. I can confirm it actually uses this file (by adding another variable manually).

To reproduce on a machine with pulseaudio running echo $AUDIODRIVER should return pulseaudio.

I've no clue why this behaviour would differ between LEAP and Tumbleweed. This package seems to be focused on Tumbleweed anyway, so don't know if that's something you wanna deal with. I'm out of ideas anyway.

@FilippoBonazziSUSE
Copy link
Collaborator

Ah, I did not realise this was for Leap. openSUSEway is generally unsupported on Leap since almost all utilities we ship configuration for have ancient versions on Leap. I don't know why this doesn't work on Leap, it seems to be a standard enough thing so I'd expect it to work. Not sure what's different

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

No branches or pull requests

2 participants