You are not logged in.

#1 2020-02-24 07:40:03

kurt
Member
Registered: 2009-09-06
Posts: 140

[SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

I want to use the KDE file picker for firefox and using the following command works:

GTK_USE_PORTAL=1 /usr/lib/firefox/firefox %u -p default

So I edited my applications menu so Internet -> Firefox used the command above.

BUT

It always states on startup that firefox is not my default browser and would I like to make it so. How ever many times I start it and say yes it always asks on next startup.

I though it might be to do with the Default Applications in System Settings.

There the radio button "in the following application:" was set and firefox was in the drop down box.

So I though I would use the "with the following command:" radio button and but the same command in as above:

GTK_USE_PORTAL=1 /usr/lib/firefox/firefox %u -p default

But even though I click Apply (it won't let you leave the page without clicking it) whenever I go back to it it still has the radio button "in the following application:" selected and firefox still asks to be my default application

EDIT

Forgot to mention that I have got installed the XDG packages:
xdg-desktop-portal 1.6.0-1
xdg-desktop-portal-kde 5.18.1-1

Last edited by kurt (2020-02-26 09:25:37)

Offline

#2 2020-02-24 14:35:54

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

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

I've had the same issue, on one of two arch installations.
Then, suddently, it went good and finally it understood what i saw it.
What i did was to follow those advices: https://ccm.net/faq/16256-firefox-disab … wser-check
...but it really didn't changed anything, as everything was just set fine.
Still, on the next startup it went good, maybe it was just the fact that i let it run for a while and did not close and reopen it immediately just to find if it understood, can't say sad

-EDIT-
Oh, i even checked my kde's default apps and noticed that firefox was still there, go figure.

Last edited by kokoko3k (2020-02-24 14:37:14)


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

Offline

#3 2020-02-24 14:45:20

kurt
Member
Registered: 2009-09-06
Posts: 140

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

kokoko3k wrote:

I've had the same issue, on one of two arch installations.
Then, suddently, it went good and finally it understood what i saw it.
What i did was to follow those advices: https://ccm.net/faq/16256-firefox-disab … wser-check
...but it really didn't changed anything, as everything was just set fine.
Still, on the next startup it went good, maybe it was just the fact that i let it run for a while and did not close and reopen it immediately just to find if it understood, can't say sad

-EDIT-
Oh, i even checked my kde's default apps and noticed that firefox was still there, go figure.

Trouble is I want firefox to be my default browser. Also its the only browser installed on my system.

If I take away the "GTK_USE_PORTAL=1" from the front of the command all works as it should. Firefox is the default and it doesn't  prompt me to make it.

Offline

#4 2020-02-25 13:23:47

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,922

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

kurt wrote:

GTK_USE_PORTAL=1 /usr/lib/firefox/firefox %u -p default

So I edited my applications menu so Internet -> Firefox used the command above.

XDG default applications usually look for .desktop files.


try copying /usr/share/applications/firefox.desktop to  ~/.local/share/applications/ as "myfirefox.desktop" , then change the Exec command to your version.
Once you're sure the  new .desktop file works, try setting it as default application.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2020-02-25 15:53:22

gnumdk
Member
Registered: 2009-10-15
Posts: 175

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

mkdir -p ~/.config/environment.d
echo "GTK_USE_PORTAL=1" > ~/.config/environment.d/gtk-portal.conf

Offline

#6 2020-02-25 20:24:17

kurt
Member
Registered: 2009-09-06
Posts: 140

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

gnumdk wrote:

mkdir -p ~/.config/environment.d
echo "GTK_USE_PORTAL=1" > ~/.config/environment.d/gtk-portal.conf

Thanks but this doesnt work. Firefox still uses the GTK file picker rather than the KDE one.

I restarted my system to make sure and no joy.

Offline

#7 2020-02-25 20:52:35

kurt
Member
Registered: 2009-09-06
Posts: 140

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

Lone_Wolf wrote:

try copying /usr/share/applications/firefox.desktop to  ~/.local/share/applications/ as "myfirefox.desktop" , then change the Exec command to your version.
Once you're sure the  new .desktop file works, try setting it as default application.

I already have a ~/.local/share/applications/firefox.desktop.

I have previously edited this file to change the exec command and I got the same problem. Every time I start firefox it states its not my default browser and ask me to confirm to make it so. Confirming does nothing. Nor does going into firefox's preferences and trying to make it the default there.

As soon as I remove GTK_USE_PORTAL=1 firefox is back to being my default browser and no prompts at start up.

I have done a search on the internet and have a few hits which state that using GTK_USE_PORTAL=1 is not recommended unless you are using it against a flatpack application. If this is so I would really like to know how to get firefox to use the KDE picker as I really dont like the GTK one.

Offline

#8 2020-02-26 05:42:46

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

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

For what is worth, my declaration lives in /etc/environment.
Put it there, then reboot and start firefox by the default .desktop file.

Last edited by kokoko3k (2020-02-26 05:43:55)


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

Offline

#9 2020-02-26 07:21:49

kurt
Member
Registered: 2009-09-06
Posts: 140

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

kokoko3k wrote:

For what is worth, my declaration lives in /etc/environment.
Put it there, then reboot and start firefox by the default .desktop file.

Again this work for getting firefox to use the KDE picker but again it means every time I start firefox it asks to be the default browser and its impossible to make it so.

I've also noticed that setting environmental variables like this means thunderbird also goes through asking about being the default email application and being unable to make it so.

It looks like I'm stuck with the GTK picker.

Offline

#10 2020-02-26 08:11:11

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,738

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

Why do you care about that notice? Last time I checked the default browser check was disableable somewhere in the settings. You can disable it from complaining and all the actual tools that will invoke firefox as your default browser via standard means are not going to care either way.

Last edited by V1del (2020-02-26 08:21:09)

Online

#11 2020-02-26 09:25:22

kurt
Member
Registered: 2009-09-06
Posts: 140

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1

V1del wrote:

Why do you care about that notice? Last time I checked the default browser check was disableable somewhere in the settings. You can disable it from complaining and all the actual tools that will invoke firefox as your default browser via standard means are not going to care either way.

OK I've gone this way. I used the /etc/environment file as that seemed the cleanest. Just changing the desktop file didn't work for links launched from other applications. Had to stop both firefox and thunderbird from checking on startup.

I run with this for now and I'll mark the thread as solved

Offline

#12 2020-03-12 11:23:04

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

Re: [SOLVED] KDE - Firefox - GTK_USE_PORTAL=1


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

Offline

Board footer

Powered by FluxBB