You are not logged in.

#1 2016-02-18 11:33:33

stupidus
Member
Registered: 2012-02-27
Posts: 124

Firefox - Launch dolphin with correct environment variable

I recently moved to i3 from KDE. I still like to use dolphin as my default file browser though. I use QT_QPA_PLATFORMTHEME=kde to launch all my QT applications with the right theme and icons. This is generally working very well. For example, when I open a .tex or .pdf file from firefox or thunderbird, it will open it in texstudio or qpdfview with the correct KDE theme. However, if I click on the "open containing folder" icon in the download manager in firefox, it will open dolphin with a fallback theme and no icons. For some reason, the QT_QPA_PLATFORMTHEME variable seems to not be used in this case.
This is not fixed using a fresh firefox profile.

I defined the variable in basically every place I could imagine, such as multiple times in ~/.i3/config and in ~/.profile. Also in my ~/.config/fish/config.fish.

I even have a keybind in my i3 config to launch firefox the following way:
bindsym b exec --no-startup-id QT_QPA_PLATFORMTHEME=kde firefox

Is there maybe some way to configure firefox, as to how to launch the filemanager?

EDIT: I copied /usr/share/applications/org.kde.dolphin.desktop to ~/.local/share/applications/ and changed the exec line to the following:

Exec=QT_QPA_PLATFORMTHEME=kde dolphin %u

That did not solve it. After that I tested what happens, if I change the default to spacefm.

xdg-mime default spacefm.desktop inode/directory

However, firefox still opens folders with the broken version of dolphin. How is the default filemanager defined in firefox?

Last edited by stupidus (2016-02-18 13:39:48)

Offline

#2 2016-07-01 15:22:59

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,473

Re: Firefox - Launch dolphin with correct environment variable

I'm facing the same issue, it seems some environment variables get lost, but not QT_QPA_PLATFORMTHEME:

Firefox environment:
# strings /proc/8718/environ |grep 'KDE\|QT'
KDE_FULL_SESSION=true
QT_QPA_PLATFORMTHEME=kde
KDE_SESSION_UID=0
QT_GRAPHICSSYSTEM=raster
QT_QPA_PLATFORM=xcb
KDE_SESSION_VERSION=4
QT_PLUGIN_PATH=/home/koko/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/
XDG_CURRENT_DESKTOP=KDE

Dolphin started by firefox environment:
# strings /proc/8805/environ |grep 'KDE\|QT'
QT_PLUGIN_PATH=/home/koko/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/
QT_GRAPHICSSYSTEM=raster
XDG_CURRENT_DESKTOP=KDE
QT_QPA_PLATFORMTHEME=kde

Dolphin started by shell environment:
# strings /proc/9280/environ |grep 'KDE\|QT'
KDE_FULL_SESSION=true
QT_QPA_PLATFORMTHEME=kde
KDE_SESSION_UID=0
QT_GRAPHICSSYSTEM=raster
QT_QPA_PLATFORM=xcb
KDE_SESSION_VERSION=4
QT_PLUGIN_PATH=/home/koko/.kde4/lib/kde4/plugins/:/usr/lib/kde4/plugins/
XDG_CURRENT_DESKTOP=KDE

Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#3 2016-07-04 13:25:09

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,473

Re: Firefox - Launch dolphin with correct environment variable

Ok, after a lot of research i manage to understand the following:
Firefox tries first to use the interface org.freedesktop.FileManager1.service, which now is supported by dolphin if started with the "--daemon" switch.
So the child process started by the listening "dolphin --daemon" will get his environment, which is not "complete".
In fact, just killing all of the dolphin instances, and then starting "dolphin --daemon" from a shell wills tart another listening dolphin with the right environment, and as expected, now the dolphin "started" by firefox will follow the system style.


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2016-07-04 15:34:06

stupidus
Member
Registered: 2012-02-27
Posts: 124

Re: Firefox - Launch dolphin with correct environment variable

Thank you for your research into that issue. I had already forgotten about it, as I uninstalled dolphin and am using pcmanfm-qt now, which is working just fine.

Offline

Board footer

Powered by FluxBB