{"action":"created","issue":{"url":"https://api.github.com/repos/swaywm/sway/issues/3109","repository_url":"https://api.github.com/repos/swaywm/sway","labels_url":"https://api.github.com/repos/swaywm/sway/issues/3109/labels{/name}","comments_url":"https://api.github.com/repos/swaywm/sway/issues/3109/comments","events_url":"https://api.github.com/repos/swaywm/sway/issues/3109/events","html_url":"https://github.com/swaywm/sway/issues/3109","id":379500725,"node_id":"MDU6SXNzdWUzNzk1MDA3MjU=","number":3109,"title":"/etc/profile is never sourced when launching sway from GDM","user":{"login":"asppsa","id":453170,"node_id":"MDQ6VXNlcjQ1MzE3MA==","avatar_url":"https://avatars1.githubusercontent.com/u/453170?v=4","gravatar_id":"","url":"https://api.github.com/users/asppsa","html_url":"https://github.com/asppsa","followers_url":"https://api.github.com/users/asppsa/followers","following_url":"https://api.github.com/users/asppsa/following{/other_user}","gists_url":"https://api.github.com/users/asppsa/gists{/gist_id}","starred_url":"https://api.github.com/users/asppsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asppsa/subscriptions","organizations_url":"https://api.github.com/users/asppsa/orgs","repos_url":"https://api.github.com/users/asppsa/repos","events_url":"https://api.github.com/users/asppsa/events{/privacy}","received_events_url":"https://api.github.com/users/asppsa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-11T08:17:52Z","updated_at":"2018-11-11T09:30:53Z","closed_at":"2018-11-11T09:00:02Z","author_association":"NONE","body":"Hi,\r\n\r\nI found that when launching Sway from GDM on Archlinux, the `/etc/profile` file never gets sourced.  I'm not sure if this counts as a bug, as the behaviour is the same for other wayland sessions that I tried, like Weston (but not Gnome, for some reason), and its only a problem when launching from a graphical login manager, as otherwise the profile is sourced already (e.g. when logging into a TTY).  My sway version:\r\n\r\n~~~\r\nsway version 1.0-beta.1-157-g994c35e3 (Nov  6 2018, branch 'master')\r\n~~~\r\n\r\nTo verify, you could do something like edit /etc/profile and add `export MY_VARIABLE=1` to that file. Then login via GDM with Sway, launch a terminal and check to see if `MY_VARIABLE` is set.  In my tests, it is not.\r\n\r\nI have been able to solve this by changing the `Exec=sway` line in `sway.desktop` to `Exec=bash -l -c sway`. This launches a login shell (which sources the profile) and then runs sway inside of the shell.  This is enough for my purposes, but I'm not sure if this is the correct way to fix this (or even if this warrants fixing) ... at any rate I figured I would report it."},"comment":{"url":"https://api.github.com/repos/swaywm/sway/issues/comments/437655383","html_url":"https://github.com/swaywm/sway/issues/3109#issuecomment-437655383","issue_url":"https://api.github.com/repos/swaywm/sway/issues/3109","id":437655383,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzY1NTM4Mw==","user":{"login":"asppsa","id":453170,"node_id":"MDQ6VXNlcjQ1MzE3MA==","avatar_url":"https://avatars1.githubusercontent.com/u/453170?v=4","gravatar_id":"","url":"https://api.github.com/users/asppsa","html_url":"https://github.com/asppsa","followers_url":"https://api.github.com/users/asppsa/followers","following_url":"https://api.github.com/users/asppsa/following{/other_user}","gists_url":"https://api.github.com/users/asppsa/gists{/gist_id}","starred_url":"https://api.github.com/users/asppsa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asppsa/subscriptions","organizations_url":"https://api.github.com/users/asppsa/orgs","repos_url":"https://api.github.com/users/asppsa/repos","events_url":"https://api.github.com/users/asppsa/events{/privacy}","received_events_url":"https://api.github.com/users/asppsa/received_events","type":"User","site_admin":false},"created_at":"2018-11-11T09:30:53Z","updated_at":"2018-11-11T09:30:53Z","author_association":"NONE","body":"My understanding is that profile files (`/etc/profile`, `~/.bash_profile`, etc.) are only sourced by login shells (e.g. `bash -l`).  `.bashrc` would be sourced for every exec, so I could of course add something there to source `/etc/profile`.  My actual solution (changing the `Exec=` line) seems to work better than this though (although it won't source my `.zprofile` if I had one).\r\n\r\nI'm using zsh, but as you ask about `/bin/sh`:\r\n\r\n~~~\r\n$ /bin/sh --version\r\nGNU bash, version 4.4.23(1)-release (x86_64-unknown-linux-gnu)\r\nCopyright (C) 2016 Free Software Foundation, Inc.\r\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\r\n\r\nThis is free software; you are free to change and redistribute it.\r\nThere is NO WARRANTY, to the extent permitted by law.\r\n~~~\r\n\r\nI also found [this discussion][1] of the same issue with relation to the same issue in Gnome under wayland. It looks like there they have [some code inside of the `gnome-session` bash script][2] which relaunches the script in a login shell when wayland is in play.\r\n\r\n[1]: https://bugzilla.gnome.org/show_bug.cgi?id=736660\r\n[2]: https://gitlab.gnome.org/GNOME/gnome-session/blob/master/gnome-session/gnome-session.in#L3"}}
{"actor":{"display_login":"asppsa"}}