This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Custom environment variables ignored in desktop environment

Tags: None
(comma "," separated)
vthie
Registered Member
Posts
6
Karma
0
Hi board!

A few days ago, something that was working previously randomly broke, and I don't know why: GTK applications no longer accept my ~/.gtkrc-2.0 file, which I edited to alter the tooltips' fore- and background colors.
After some googling, I found that my environment variable GTK2_RC_FILES was unset. I tried to fix this by issueing
Code: Select all
export GTK2_RC_FILES=$HOME/.gtkrc-2.0
in ~/.config/plasma-workspace/env/gtk-paths.sh. In fact, this resulted in the environment variable being exported when checked from within Konsole, and when I run inkscape or gimp from within Konsole, the changed tooltips are applied and everything is working as it should.

However, when I run either application from Krunner or the Application menu, the changes are not applied and the tooltips keep their initial state, which is white text on white background. Aside from ~/.config/plasma-workspace/env/gtk-paths.sh, I also tried placing the export in:
  • ~/.kde/env/gtk-paths.sh
  • ~/.kde4/env/gtk-paths.sh
  • ~/.xprofile

None of these options worked.
I would be happy for any further input on how to make the desktop and Krunner recognize my environment variables.

Thanks!
User avatar
einar
Administrator
Posts
3402
Karma
7
OS
Are you sure they're not somehow unset or overridden?


"Violence is the last refuge of the incompetent."
Image
Plasma FAQ maintainer - Plasma programming with Python
luebking
Karma
0
check /usr/bin/startkde, does it somewhere say
Code: Select all
(test -r "$file" && . "$file") || :


in case, make that
Code: Select all
test -r "$file" && . "$file" || true


See https://bugs.kde.org/show_bug.cgi?id=352491
vthie
Registered Member
Posts
6
Karma
0
luebking wrote:check /usr/bin/startkde, does it somewhere say
Code: Select all
(test -r "$file" && . "$file") || :


in case, make that
Code: Select all
test -r "$file" && . "$file" || true


See https://bugs.kde.org/show_bug.cgi?id=352491


The second, corrected version was already present in my file on line 209.

einar wrote:Are you sure they're not somehow unset or overridden?


I'm afraid I am not. How could I check that?

Also, I realised the following information may be useful: I am running Arch Linux, and I have these Plasma packages installed:
Code: Select all
local/bluedevil 1:5.4.3-1 (plasma)
local/breeze 5.4.3-2 (plasma)
local/drkonqi 5.4.3-1 (plasma)
local/kde-gtk-config 5.4.3-1 (plasma)
local/kdeplasma-addons 5.4.3-1 (plasma)
local/kgamma5 5.4.3-1 (plasma)
local/khelpcenter 5.4.3-1 (plasma)
local/kinfocenter 5.4.3-1 (plasma)
local/kmenuedit 5.4.3-1 (plasma)
local/kscreen 5.4.3-1 (plasma)
local/ksshaskpass 5.4.3-1 (plasma)
local/ksysguard 5.4.3-1 (plasma)
local/kwallet-pam 5.4.3-1 (plasma)
local/kwayland-integration 5.4.3-1 (plasma)
local/kwin 5.4.3-1 (plasma)
local/kwrited 5.4.3-1 (plasma)
local/milou 5.4.3-1 (plasma)
local/oxygen 5.4.3-1 (plasma)
local/oxygen-cursors 5.4.3-1 (plasma)
local/plasma-desktop 5.4.3-1 (plasma)
local/plasma-framework 5.16.0-2 (kf5)
local/plasma-mediacenter 5.4.3-1 (plasma)
local/plasma-meta 5.4-2
local/plasma-nm 5.4.3-1 (plasma)
local/plasma-pa 5.4.3-1 (plasma)
local/plasma-workspace 5.4.3-1 (plasma)
local/plasma-workspace-wallpapers 5.4.3.1-1 (plasma)
local/powerdevil 5.4.3-1 (plasma)
local/sddm-kcm 5.4.3-1 (plasma)
local/systemsettings 5.4.3-1 (plasma)
local/user-manager 5.4.3-1 (plasma)
luebking
Karma
0
[code]
tr '\0' '\n' < /proc/`pidof krunner`/environ | grep GTK
tr '\0' '\n' < /proc/`pidof plasmashell`/environ | grep GTK
tr '\0' '\n' < /proc/`pidof bad_gtk_process`/environ | grep GTK
[code]
vthie
Registered Member
Posts
6
Karma
0
luebking wrote:
Code: Select all
tr '\0' '\n' < /proc/`pidof krunner`/environ | grep GTK
tr '\0' '\n' < /proc/`pidof plasmashell`/environ | grep GTK
tr '\0' '\n' < /proc/`pidof bad_gtk_process`/environ | grep GTK


Thank you! That pointed me to the right direction. Turns out, the problem was not that the config file could not be found, but that it was overwritten by another one. For the plasma applications: GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/vik/.gtkrc-2.0:/home/vik/.config/gtkrc-2.0
In /home/vik/.confif/gtkrc-2.0, I commented out the lines
Code: Select all
widget "gtk-tooltip" style "ToolTip"
widget "gtk-tooltips" style "ToolTip"


Tooltips are now displayed as expected, but this solution feels a little hackish. Is there a more proper way to deal with this?
luebking
Karma
0
Quoting that file:
# If you do not want KDE to override your GTK settings, select
# Appearance -> Colors in the System Settings and disable the checkbox
# "Apply colors to non-KDE4 applications"
vthie
Registered Member
Posts
6
Karma
0
Duh ... thanks. For reference's sake, in Plasma 5 it's found under System Settings -> Colors -> Options Tab -> "Apply colors to non-Qt applications".


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]