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

users should be able to set environment variables in cinnamon-session #15

Open
brianjmurrell opened this issue Feb 24, 2014 · 9 comments

Comments

@brianjmurrell
Copy link

There appears to be no way for an individual user to be able to set an environment variable in their cinnamon-session (i.e. such that all child processes inherit that variable).

Variables in /etc/environment are set into the users' cinnamon-session but users ought to be able to (a) do this without asking root to help and (b) set variables for only their own session and not every users' sessions.

@emmaly
Copy link

emmaly commented Nov 16, 2014

I was able to set per-user environment variables via ~/.xsessionrc. I'm running with lightdm+cinnamon on Debian Jessie. I don't know for certain, but I believe it's actually lightdm that is reading that file to set variables before cinnamon starts running.

@brianjmurrell
Copy link
Author

@dustywilson: Thanks for the suggestion but the problem is that is log-in manager dependent. The point of this ticket is that one ought to be able to do this in Cinnamon without having to change log-in managers to do it.

@emmaly
Copy link

emmaly commented Nov 17, 2014

I understand and agree. I found this bug report while seeking out a solution, so I provided one when I figured it out in a way that worked on my system as configured. I do hope the issue is resolved correctly soon. Thanks!

@glebihan
Copy link
Member

The place to define per-user environment variables is ~/.profile.
That works without the need for root permissions and is not dm-dependant.

@emmaly
Copy link

emmaly commented Nov 21, 2014

On my system (Debian Jessie, lightdm 1.10.3, cinnamon 2.2.16) ~/.profile is not used. It would be appropriate for it to be used, but the variables listed there do not effect anything spawned via the GUI. In my case I'm setting my GOPATH (for golang). It is effective for me via ~/.xsessionrc.

@ghost
Copy link

ghost commented Mar 18, 2015

I agree, i need insert this code to allow the global menu implementation, nemo started so faster and i can not register the environment variables after the start of nemo... so, nemo as a gtk2 app is not called with the correct environment to be translated the appmenu, so, i fail to get a Dbus connection...

  g_setenv ("UBUNTU_MENUPROXY", "1", FALSE);
  const gchar *gtk_modules;

  gtk_modules = g_getenv ("GTK_MODULES");
  if (gtk_modules != NULL) {
    if(!g_str_match_string("unity-gtk-module", gtk_modules, FALSE)) {
      const gchar * new_gtk_modules = g_strconcat( "unity-gtk-module:", gtk_modules, NULL );
      g_setenv ("GTK_MODULES", new_gtk_modules, TRUE);
    }
  } else {
    g_setenv ("GTK_MODULES", "unity-gtk-module", FALSE);
  }

@Nowaker
Copy link

Nowaker commented Jul 13, 2020

It doesn't look like adding an env var to ~/.xsessionrc has an effect on my Cinnamon when using Slim DM. In my case, I had to put the env vars in ~/.xinitrc.

@ItzSwirlz
Copy link
Contributor

Well, what environment variables are you thinking of?

@PowaBanga
Copy link

PowaBanga commented Dec 3, 2024

GTK_THEME could be a nice one...
All my GTK4 theme are not working because of that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants