LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Purpose of htmlview in pkgtool; default browser (https://www.linuxquestions.org/questions/slackware-14/purpose-of-htmlview-in-pkgtool%3B-default-browser-4175478791/)

elesmod 09-27-2013 04:36 PM

Purpose of htmlview in pkgtool; default browser
 
In pkgtool, Setup, there's a script "htmlview - Set a default browser link". Nothing happens when I run it. Upon closer inspection, it's only a one-line script:
Code:

#!/bin/sh
exec konqueror "$@"

When I try to execute it normally, it starts konqueror of course.

Now, when I open links from:
1) LibreOffice, they open in Seamonkey (which I want)
2) Mumble - in Firefox (which I don't like)
3) Okular - since it's a KDE program, I thought it would open in konqueror, but no, it opens in Seamonkey too, however not the actual website, but only a cashed file from var/tmp/kdecache-elesmod/krun (:scratch:)

So what's the purpose of that htmlview script? Did it used to work and now it's obsolete? Or maybe it has some use which I haven't figured out?

volkerdi 09-27-2013 05:54 PM

Quote:

Originally Posted by elesmod (Post 5036096)
In pkgtool, Setup, there's a script "htmlview - Set a default browser link". Nothing happens when I run it. Upon closer inspection, it's only a one-line script:
Code:

#!/bin/sh
exec konqueror "$@"

When I try to execute it normally, it starts konqueror of course.

Now, when I open links from:
1) LibreOffice, they open in Seamonkey (which I want)
2) Mumble - in Firefox (which I don't like)
3) Okular - since it's a KDE program, I thought it would open in konqueror, but no, it opens in Seamonkey too, however not the actual website, but only a cashed file from var/tmp/kdecache-elesmod/krun (:scratch:)

So what's the purpose of that htmlview script? Did it used to work and now it's obsolete? Or maybe it has some use which I haven't figured out?

I'm not exactly sure where I picked that up from, other than I don't think I wrote it. For one thing, I'm not in the habit of referring to myself as Pat (or as Bob Dole).

IIRC, some other distribution (I think it was Debian, but I'm not sure) began shipping such a script, and there are now some KDE and GTK+ things that expect to be able to start a browser with it. If the script isn't there, they can't open a browser.

It appears that either the test order should be reversed, or the loop should exit when the first browser is found. The browsers seem to be listed in preferred order, but the way it is processed now leaves the least preferred browser in the htmlview script.

Currently only geeqie and kalzium are using this, so it has nothing to do with the behavior of those other programs. Those are probably hardcoded according to their developers' own preferences. Perhaps they should be using this script so the preference could be assigned in a single location.

elesmod 09-28-2013 03:53 AM

Ok, thanks for the explanation.

Poprocks 09-30-2013 09:20 AM

I believe Bernhard Rosenkraenzer ("bero"), formerly a Red Hat employee, wrote it. I remember older Red Hat releases had a globe icon browser launcher on gnome-panel that ran htmlview and other RH config tools used it too.

I remember bero pulling it into Ark Linux when he forked RH. I did a bit of packaging for Ark and remember patching it to look for KDE's default web browser if you were running KDE and GNOME's default if you were running GNOME. If you were running neither, it would go fall back on going through a list unless you put some config file in /etc.

So yeah. That's my story.

jtsn 10-02-2013 08:09 AM

Quote:

Originally Posted by volkerdi (Post 5036127)
Currently only geeqie and kalzium are using this, so it has nothing to do with the behavior of those other programs. Those are probably hardcoded according to their developers' own preferences. Perhaps they should be using this script so the preference could be assigned in a single location.

I think, "xdg-open" is the correct command to launch the user's preferred browser. It also accepts URLs.

jrosevear 04-08-2016 06:59 PM

I wonder if there was a misunderstanding among some of the posters to this thread. I found this thread when I too became curious about htmlview. I found htmlview, just as the OP, in pkgtool's list of setup scripts. I was actually looking for the script that makes Slackware boot sticks.

Curious about the htmlview entry in the list, I looked and found /usr/bin/htmlview. I imagine that the OP did the same thing. And, as I suppose the OP did, I looked at the script and wondered why a setup script was needed that did next to nothing.

Fueled by my interest in finding the script that made boot sticks I dug a little deeper and found /var/log/setup. It seems that this directory holds the setup scripts that correspond to pkgtool's list. On reading the script and comments by the posters, I figured it out. Now it makes sense.

Yes, the /usr/bin/htmlview does next to nothing, but it is needed apparently by some applications. I can see how it could be useful. The setup script, /var/log/setup/setup.htmlview, creates /usr/bin/htmlview if it does not exist, but a browser does exist.

I also looked up volkerdi's reference to Bob Dole. I'm guessing that it was a tongue in cheek reference to Pat Buchanan and Bob Dole having competed in the 1996 Republican presidential primary.

And I think found the script that makes boot sticks. I believe it is /var/log/setup/setup.80.make-bootdisk.


All times are GMT -5. The time now is 01:10 PM.