[SOLVED] Purpose of htmlview in pkgtool; default browser
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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 ()
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?
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 ()
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.