You are not logged in.

#1 2016-02-17 00:22

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,993

sensible-browser does not point to default browser

I found this out when using a script to open a web page, I thought sensible-browser pointed to the users default (preferred) web browser, but every time I use the command it opens konqueror (my default is set to iceweasel). I have found how to change it using

sudo update-alternatives --config x-www-browser 

but my question is,
how (in a script) can I call the users preferred (set to default) browser?
I figure this is not a q4os problem as a simple web search guided me to other peoples issues with this on other os's.
Any suggestions welcome

Dai

Offline

#2 2016-02-17 00:47

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,993

Re: sensible-browser does not point to default browser

Scratch that I found it xdg-open if anyone else is curious

Dai

EDIT: this didn't work, tried it on another system, it only worked as I changed using the command in the previous post...
anybody know anything?

Last edited by Dai_trying (2016-02-17 01:01)

Offline

#3 2016-02-17 19:44

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,993

Re: sensible-browser does not point to default browser

No problem cc I'm trying to get a web page opened from a bash script.
I can use the two commands mentioned previously, but they do not always use the broswer that the user has set (usually from within the browser preferences) as default. It's not really a big deal as sensible-browser and xdg-open both work. It's just that what they percieve as the users browser is not always the same as the users choice.
I don't want to call a specific browser in my script as it may not always be available, so I wanted a generic name I could use to call the default.
I hope that clears things up a little smile

Dai

Offline

#4 2016-02-17 20:45

q4osteam
Q4OS Team
Registered: 2015-12-06
Posts: 4,502
Website

Re: sensible-browser does not point to default browser

Set the default browser in:
Control Panel -> KDE Components -> Default applications -> Web browser
Then run:
$ kfmclient openURL http://www.q4os.org

Offline

#5 2016-02-17 21:00

Dai_trying
Member
From: UK
Registered: 2015-12-14
Posts: 2,993

Re: sensible-browser does not point to default browser

Thanks @Q4OS Team, but the issue here is I want to open the browser that the user has set as default from within the browser, as this is where most users would set their preference. I can't get my head around why there are so many different areas that preferences can be made but none of them seem to respect the others choice??
Like I said before though it is not really a big issue as a web page is opened, it just might not be in the browser the user prefers to use...

Dai

Offline

Board footer

Powered by FluxBB