Bug 321281

Summary: starting gtk apps via shortcut uses ugly default theme instead of configured one
Product: [Applications] systemsettings Reporter: arne anka <kde-bugs>
Component: kcm_khotkeysAssignee: Michael Jansen <kde>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: brent, cfeck, justin.zobel, kde, thomas.luebking
Priority: NOR    
Version First Reported In: 5.20.3   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description arne anka 2013-06-17 16:33:28 UTC
starting eclipse or firefox via a custom shortcut (system settings->shortcust and gestures, command/url shortcut) suddenly starts them in an ugly theme which seems to be the fallback and has nothing to do with the one konfigured.

using instead krunner (alt+f2) or a quicklaunch launcher from the panel, the theme is correctly applied.


Reproducible: Always

Steps to Reproduce:
1. configure gtk theme for FF or Eclipse
2. configure shortcut (custom shortcut, "command/URL")
3. execute shortcut -- theme is ignored
4. start with krunner (alt+f2), konsole or quicklaunch launcher -- theme is applied correctly
Actual Results:  
theme's not applied

Expected Results:  
theme should be applied

removed .gtkrc-2.0* and .config/gtk*, but that didn't change anything
Comment 1 arne anka 2013-07-02 08:06:21 UTC
i set it to critical since it makes shortcuts virtually unusable for gtk applications.
Comment 2 Thomas Lübking 2015-10-17 17:42:41 UTC
At least kded5 has an empty environment, so GTK won't resolve GTK*_RC_FILES so you get no theme.

No idea whether kded clears the environment for security reasons, but on sth. like
env GTK2_RC_FILES=/home/username/.gtkrc-2.0 firefox

This is not fixable from khotkeys, passing on to kded, might be because of the startkde scripts (but I doubt so, given the environment is *really* empty, it's likely cleared on startup)


errr... Christoph, do you know where kded's bugzilla is?
Comment 3 Christoph Feck 2015-10-18 10:25:47 UTC
frameworks-kdaemon

But I would suggest to check which kded module is responsible (by disabling them in turn) first.
Comment 4 Thomas Lübking 2015-10-18 11:21:27 UTC
Starting kded5 from within a session doesn't show this problem anyway, so the environment will be cleared by its invocation on session startup.
Comment 5 Thomas Lübking 2015-10-18 11:36:52 UTC
fwwi, I've no problems with gtk+, likely because ~/.gtkrc-2.0 is looked up by default, whereas the OP probably relies on some ~/.gtkrc-kde written by the gtk kcm?
Comment 6 hexchain 2018-12-10 21:31:01 UTC
I've run into this problem today (by starting Inkscape via KRunner).

The visible effect from this bug is that ~/.config/gtkrc-2.0 will affect the color of GTK+ programs when "Apply colors to non-Qt applications" is enabled in system settings.
Comment 7 hexchain 2018-12-10 21:31:24 UTC
I've run into this problem today (by starting Inkscape via KRunner).

The visible effect from this bug is that ~/.config/gtkrc-2.0 will affect the color of GTK+ programs when "Apply colors to non-Qt applications" is enabled in system settings.
Comment 8 Brent 2020-12-29 13:24:08 UTC
I noticed that I even have it with KDE apps now: anything launched through Krunner ignores theme settings and looks like a KDE4 app, while launched in any other way has a theme as expected. I have an updated Fedora 33 KDE spin.
Comment 9 Justin Zobel 2021-03-17 23:08:18 UTC
I've just tested this on Operating System: Solus 4.2
KDE Plasma Version: 5.21.2
KDE Frameworks Version: 5.79.0
Qt Version: 5.15.2

However, I can't replicate the issue. I set the GTK theme to Arc and applied it, I launched Remmina (GTK application) from konsole, kickoff, krunner and via my shortcut and it showed in the Arc theme each time.
Comment 10 Nate Graham 2024-03-04 19:42:12 UTC
As announced in https://pointieststick.com/2023/07/26/what-we-plan-to-remove-in-plasma-6/ and https://community.kde.org/Plasma/Plasma_6#Removals, I'm afraid KHotKeys has reached end-of-life in Plasma 6. Accordingly, all bug reports and feature requests for it must be closed now.

Most of what KHotKeys could do can already be done with the newer KGlobalAccel system in Plasma 6. A few features such as mouse gestures and triggering conditions based on changes to window states are not yet implemented in the new system. These will be added in the future if and when resources materialize for them, and/or when a kind soul submits patches to implement them! :) Meanwhile, the 3rd-party "Mouse Actions" app (https://github.com/jersou/mouse-actions) may be usable for implementing your own mouse gestures again.

Thanks for your understanding, everyone.