[Bug 1181392] New: sway should source /etc/profile ~/.profile etc.
https://bugzilla.suse.com/show_bug.cgi?id=1181392 Bug ID: 1181392 Summary: sway should source /etc/profile ~/.profile etc. Classification: openSUSE Product: openSUSE Tumbleweed Version: Current Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: screening-team-bugs@suse.de Reporter: mcepl@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- When Gnome session starts all application have in their environment variables from /etc/profile (and ~/.profile). Sway doesn���t. It would be awfully convenient, if sway would do it as well. I cannot find anywhere in gdm/gnome files where this configuration happens, but I have met even this trick (https://tech.akom.net/archives/93-Getting-a-systemd-unit-to-read-your-.bashr...) [Service] Type=simple User=some_user # Process the normal environment files for this user by starting a login shell # and outputting it all in a temp file. This makes it compatible # with the non-systemd init scripts that still rely on .bashrc ExecStartPre=/bin/bash --login -c 'env > /tmp/.magic-environment-file' ExecStart=SERVICE_COMMAND EnvironmentFile=-/tmp/.magic-environment-file -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1181392 https://bugzilla.suse.com/show_bug.cgi?id=1181392#c1 Matej Cepl <mcepl@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|screening-team-bugs@suse.de |mvetter@suse.com --- Comment #1 from Matej Cepl <mcepl@suse.com> --- Also, https://www.reddit.com/r/swaywm/comments/f98jlp/how_to_source_environment_va... -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1181392 https://bugzilla.suse.com/show_bug.cgi?id=1181392#c3 --- Comment #3 from Matej Cepl <mcepl@suse.com> --- (In reply to Denys Kondratenko from comment #2)
How do you login ? What login manager do you use?
gdm (I was using Gnome until then, just installed sway package, logged out of the Gnome session, and logged in with Sway selected from the option button in the login menu).
`/etc/profile*` looks to be used for bash interactive login. If you start sway from bash, env should be there.
No, /etc/profile is used only with --login bash (and then ~/.bashrc is not used). And I would like to have environmental variables set for ALL applications started from Sway, including graphical ones (e.g., my own $PATH and many other ones), not only applications run from terminal application.
openSUSEway uses greetd to login, and `sway-run.sh` script to init some of the variables for apps to run under Wayland.
Is it a good idea to put all customization in special package. Users (like me) expect sway package just work, not being half baked. And apparently there are SOME customizations, but not all of them.
Also there is `environment.d` method for systemd services.
You mean /etc/environment file? Hmm, it starts with the comment: # This file is parsed by pam_env module So, it is even more complicated.
I don't really know how GDM and others are initializing and if it is correct to source `profile` files for sway.
Hmm, https://src.fedoraproject.org/rpms/sway/blob/master/f/sway.spec does even less than us. And Debian is similarly minimalistic https://sources.debian.org/patches/sway/1.5-7/0002-Modify-default-configurat... . -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1181392 https://bugzilla.suse.com/show_bug.cgi?id=1181392#c4 --- Comment #4 from Michael Vetter <mvetter@suse.com> ---
Is it a good idea to put all customization in special package. Users (like me) expect sway package just work, not being half baked. And apparently there are SOME customizations, but not all of them.
sway just works. We don't customize half baked :-)
Hmm, https://src.fedoraproject.org/rpms/sway/blob/master/f/sway.spec does even less than us. And Debian is similarly minimalistic https://sources.debian.org/patches/sway/1.5-7/0002-Modify-default-configurat... .
Does not seem more or less minimalistic than what we do I think: https://build.opensuse.org/package/view_file/X11:Wayland/sway/sway.spec?expa... We have sway. Later sway-branding-upstream and sway-branding-openSUSE got introduced when openSUSEway was being discussed. Also check out: https://build.opensuse.org/package/view_file/X11:Wayland/openSUSEway/openSUS... Also: https://github.com/openSUSE/openSUSEway/issues/32#issuecomment-763036721 And: https://github.com/openSUSE/openSUSEway/issues/32#issuecomment-763039328 -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1181392 https://bugzilla.suse.com/show_bug.cgi?id=1181392#c6 --- Comment #6 from Matej Cepl <mcepl@suse.com> --- (In reply to Denys Kondratenko from comment #5)
OK, so that just uses `/usr/share/wayland-sessions/sway.desktop` to execute sway either directly or with the script. Check it out.
Hmm, do I understand it correctly, that if I create script /usr/local/bin/sway it will be run instead of /usr/bin/sway? -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1181392 https://bugzilla.suse.com/show_bug.cgi?id=1181392#c7 --- Comment #7 from Matej Cepl <mcepl@suse.com> --- (In reply to Matej Cepl from comment #6)
Hmm, do I understand it correctly, that if I create script /usr/local/bin/sway it will be run instead of /usr/bin/sway?
So, yes, this /usr/local/bin/sway script helps: #!/bin/bash # /etc/profile cannot be sourced, because read-only variable _HOMEBASHRC has # been already set. . $HOME/.profile exec /usr/bin/sway "$@" I wonder whether sourcing of ~/.profile shouldn���t be made default. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1181392 https://bugzilla.suse.com/show_bug.cgi?id=1181392#c8 --- Comment #8 from Matej Cepl <mcepl@suse.com> --- And yes hack in comment 0 doesn���t work, because `env` does quote multi-word string values. I was told to use `declare -xp` instead, but that doesn���t generate anything at all. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1181392 https://bugzilla.suse.com/show_bug.cgi?id=1181392#c9 --- Comment #9 from Denys Kondratenko <stdden@opensuse.org> --- Hi @Matej, I think sway itself is just a WM that shouldn't be responsible for the env. They do provide extensive doc on how those should be tuned. It is usually implemented in DE like here: https://github.com/openSUSE/openSUSEway/blob/main/sway/sway-run.sh
Hmm, do I understand it correctly, that if I create script /usr/local/bin/sway it will be run instead of /usr/bin/sway?
probably, in the desktop file that is in DE - it executes sway0run.sh that loads env.
I wonder whether sourcing of ~/.profile shouldn���t be made default.
it does it from different file in DE. .profile as I mentioned has special meaning, maybe doesn't fit for DE. And it is hard to do it for home dir, that why DE file is in etc. Thanks, Denys -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1181392 https://bugzilla.suse.com/show_bug.cgi?id=1181392#c10 Michael Vetter <mvetter@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |WONTFIX --- Comment #10 from Michael Vetter <mvetter@suse.com> --- so i think we can close this -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com