You are not logged in.

#1 2017-07-19 14:49:47

wangchong
Member
Registered: 2013-06-25
Posts: 76

[Solved]What file does gnome on wayland source?

I am using gnome on wayland and I need to source some files before every session. For example, I need to set input method and qt5 style before my session starts. Using gnome on xorg, I can just use .profile or .xprofile, which is not sourced by gnome on wayland. How can I achieve the same effect on gnome on wayland?

Last edited by wangchong (2017-07-24 16:19:05)

Offline

#2 2017-07-19 15:45:08

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: [Solved]What file does gnome on wayland source?

If globally, I'd suggest setting variables in '/etc/environment' and/or create scripts in '/etc/profile.d/'.

If for a specific user, I'd say set variables in '~/.pam_environment' and/or in whatever is sourced by your user's shell.

Offline

#3 2017-07-19 16:21:17

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved]What file does gnome on wayland source?

Omar007 wrote:

If globally, I'd suggest setting variables in '/etc/environment' and/or create scripts in '/etc/profile.d/'.

If for a specific user, I'd say set variables in '~/.pam_environment' and/or in whatever is sourced by your user's shell.

The whole problem to start with is that your user's shell is irrelevant on wayland which does not source the usual shell login files.

But yes, ~/.pam_environment is the way to go here. And once you do that, putting it in ~/.bashrc for terminal use is redundant.

Last edited by eschwartz (2017-07-19 16:22:17)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2017-07-19 16:54:13

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: [Solved]What file does gnome on wayland source?

Eschwartz wrote:

The whole problem to start with is that your user's shell is irrelevant on wayland which does not source the usual shell login files.

I never said login files wink
On Wayland your shell will still be sourcing certain files. You just need to look up whatever those are for your shell.

That said, my personal preferences goes to pam for this so things are not depending on whatever shell I'm using.

Last edited by Omar007 (2017-07-19 17:04:05)

Offline

#5 2017-07-19 17:31:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,523
Website

Re: [Solved]What file does gnome on wayland source?

Omar007 wrote:

On Wayland your shell will still be sourcing certain files.

How is that relevant to the question the OP is asking?  The OP needs to set environment variables for the entire gnome session, not just for shells launched within that session.  This is assuming by shell you mean something like bash/zsh or anything else that would run in a terminal emulator.  If you mean shell as in the wayland equivalent of a window-manager than this is precisely what the OP was asking: what files does gnome-shell on wayland source.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#6 2017-07-19 18:38:25

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [Solved]What file does gnome on wayland source?


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#7 2017-07-19 20:43:57

Omar007
Member
Registered: 2015-04-09
Posts: 368

Re: [Solved]What file does gnome on wayland source?

Trilby wrote:
Omar007 wrote:

On Wayland your shell will still be sourcing certain files.

How is that relevant to the question the OP is asking?  The OP needs to set environment variables for the entire gnome session, not just for shells launched within that session.  This is assuming by shell you mean something like bash/zsh or anything else that would run in a terminal emulator.  If you mean shell as in the wayland equivalent of a window-manager than this is precisely what the OP was asking: what files does gnome-shell on wayland source.

For Gnome specifically, I think you can drop files in '/usr/share/gdm/env.d/'?

Edit: according to https://wiki.gnome.org/Initiatives/Wayland/SessionStart that should indeed be the case.

Last edited by Omar007 (2017-07-19 20:45:08)

Offline

#8 2017-07-20 03:40:30

wangchong
Member
Registered: 2013-06-25
Posts: 76

Re: [Solved]What file does gnome on wayland source?

Omar007 wrote:
Trilby wrote:
Omar007 wrote:

On Wayland your shell will still be sourcing certain files.

How is that relevant to the question the OP is asking?  The OP needs to set environment variables for the entire gnome session, not just for shells launched within that session.  This is assuming by shell you mean something like bash/zsh or anything else that would run in a terminal emulator.  If you mean shell as in the wayland equivalent of a window-manager than this is precisely what the OP was asking: what files does gnome-shell on wayland source.

For Gnome specifically, I think you can drop files in '/usr/share/gdm/env.d/'?

Edit: according to https://wiki.gnome.org/Initiatives/Wayland/SessionStart that should indeed be the case.

What if I want a user-specific solution?

Offline

#9 2017-07-20 05:56:37

seth
Member
Registered: 2012-09-03
Posts: 51,053

Re: [Solved]What file does gnome on wayland source?

Did you see comment #2?

man pam_env

Otherwise this highly depends on how you're starting gnome-shell itfp - unless gnome-shell actively nukes the inherited environment.

Offline

#10 2017-07-21 17:41:26

wangchong
Member
Registered: 2013-06-25
Posts: 76

Re: [Solved]What file does gnome on wayland source?

.pam_environment is working. Thank you.

Last edited by wangchong (2017-07-24 16:18:51)

Offline

Board footer

Powered by FluxBB