linuxmint / nemo

File browser for Cinnamon
GNU General Public License v2.0
1.17k stars 297 forks source link

Nemo resets variables specified in ~/.bash_profile for MIME applications #3328

Open itz-me-zappex opened 7 months ago

itz-me-zappex commented 7 months ago

Distribution

Arch Linux

Package version

6.0.0

Frequency

Always

Bug description

When i open any app from Nemo, it opens specified file but it ignores all variables which were set in ~/.bash_profile, for example i have export GTK_THEME=Fluent-Dark-compact in profile, GTK4 apps applies this theme system-wide and it works like expected, but if i open any font via gnome-font-viewer as choice in MIME list, Nemo will open it without any variable (i.e. theme simply unsets). P.S.: does not happen in PCManFM (GTK3 version, from LXDE) but also happens in Thunar (XFCE4)

Steps to reproduce

Add GTK_THEME=<your-theme> to shell profile, install any GTK4 application (non-flatpak) and then choose it as app in which you want open file.

Expected behavior

Variables should be passed to applications.

Additional information

No response

Jeremy7701 commented 7 months ago

Why would any GUI program look in ~/.bash_profile ? Anyway, I don't even have a ~/.bash_profile in LMDE6.

itz-me-zappex commented 7 months ago

These variables are sets automatically on login from specified file (from which file depends on shell, login manager, configuration etc.), applications just should use or ignore these variables, in case with nemo, it just unsets all variables for applications which were launched from it (MIME apps as example).

itz-me-zappex commented 7 months ago

Also LightDM looks for ~/.profile by default, i just use SDDM (which looks for ~/.bash_profile) with Cinnamon on Arch Linux.

itz-me-zappex commented 7 months ago

If that issue not reproducible (i.e. just on my side), i will just close issue.

AlexFolland commented 6 months ago

Considering how environment variables work, this seems like it is not specifically related to .bash_profile or any individual file that's used by a login manager to set environment variables, but instead that Nemo is not inheriting all environment variables. Is Nemo explicitly unsetting environment variables? If so, that could be the source of the issue. If not, why would a particular environment variable be ignored by Nemo?

Lassebq commented 6 months ago

GTK_THEME env variable is not recommended to be used for global theming (running a single application with specified theme is fine though).

Set dconf property with gsettings

gsettings set org.gnome.desktop.interface gtk-theme "Theme Name"

Or choose a theme in your DE/WM configuration utility, if you aren't on gnome or any wlroots compositors

Lassebq commented 6 months ago

Also, note that gnome apps which are based on libadwaita are only able to use GTK_THEME variable. To bring support for dconf property back use a patched version from AUR