Browser Installer - choose your browser

Browsers, email, chat, etc.
Post Reply
Message
Author
User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

Browser Installer - choose your browser

#1 Post by sc0ttman »

This is for puppy 4.2.x and maybe 4.3.x

01micko released the original here.
I have added a few more browsers, and made it work (for me, at least) in 4.2

I've added '-pa' to the end of the filename as it will be used in Puppy Arcade 8

I have created a few new .pet packages of browsers,
adding a few libs and menu entries so they work 'out of the box' in 4.2..

The browsers I (and others) packaged are hosted at ppm.scottjarvis.com

To customise, edit the the config file, /root/.browser-links.config.. and the main file /usr/sbin/browser-installer

This is primarily designed for my next project, and is offered as is...

NOTE: Google Chrome needs work, before it works

All credit goes to 01micko for the original!!!!!!
Attachments
browser-installer-pa.pet
updated to new urls
(87.7 KiB) Downloaded 1033 times
browser-installer-pa.pet
old version, links no longer work
(86.54 KiB) Downloaded 849 times
browser-installer.png
screenshot
(138.73 KiB) Downloaded 2734 times
Last edited by sc0ttman on Mon 17 May 2010, 21:34, edited 3 times in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#2 Post by sc0ttman »

Possible improvements, that I wanna make:

- re-build the defaultbrowser file after each browser is installed, with the relevant command (help me please!)
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
WarMocK
Posts: 169
Joined: Thu 05 Jul 2007, 11:53

#3 Post by WarMocK »

sc0ttman,
you could use sed:

Code: Select all

cp /usr/local/bin/defaultbrowser /tmp/defaultbrowser
sed -e 's/seamonkey/firefox/g' /tmp/defaultbrowser > /usr/local/bin/defaultbrowser
Do this for opera, chrome etc as well, or use case to create a clause for every browser selected. Personally I would do it a different way, but that's because I threw the original default scripts out and replaced them with new ones that start the program listed in a separate config file in my home directory. ;-)

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#4 Post by sc0ttman »

WarMocK wrote:sc0ttman,
you could use sed:

Code: Select all

cp /usr/local/bin/defaultbrowser /tmp/defaultbrowser
sed -e 's/seamonkey/firefox/g' /tmp/defaultbrowser > /usr/local/bin/defaultbrowser
Do this for opera, chrome etc as well, or use case to create a clause for every browser selected.
Thanks a lot, that helps me a little.. However...

While I need to be able to change the final line in defaultbrowser, (as it has the command to be replaced), I will not know what value that line contains, so cannot replace one fixed string with another..

I think the easy way to do this is simply replace the last line of the file, with a new string... How do I do this?

I read you can't combine a sed 'd' and 'a' as the 'd' command ends things...
So I don't know how I would do this.. Help, anyone?
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
WarMocK
Posts: 169
Joined: Thu 05 Jul 2007, 11:53

#5 Post by WarMocK »

After reading out what browser was chosen:

Code: Select all

echo "#!/bin/sh" > /tmp/browserchange
echo "sed -e 's/seamonkey/$BROWSER/g' /tmp/defaultbrowser > /usr/local/bin/defaultbrowser" >> /tmp/browserchange
chmod +x /tmp/browserchange
sh /tmp/browserchange
That'll create a script which replaces the standard entry for the browser with the variable $BROWSER (aka what was selected) in /tmp, then makes it executable and runs it, modifying defaultbrowser.

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#6 Post by sc0ttman »

WarMocK wrote:After reading out what browser was chosen:

Code: Select all

echo "#!/bin/sh" > /tmp/browserchange
echo "sed -e 's/seamonkey/$BROWSER/g' /tmp/defaultbrowser > /usr/local/bin/defaultbrowser" >> /tmp/browserchange
chmod +x /tmp/browserchange
sh /tmp/browserchange
That'll create a script which replaces the standard entry for the browser with the variable $BROWSER (aka what was selected) in /tmp, then makes it executable and runs it, modifying defaultbrowser.
Thanks again for your quick response... And, while I'm a total novice at this stuff, I think this won't work for me..

This is because I cannot assume the default browser is Seamonkey..

When replacing the command in defaultbrowser that actually executes the browser, I cannot assume this line contains the string 'seamonkey'..

I'm sure the solution is very simple, but I certainly don't know it!!! :roll:
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
WarMocK
Posts: 169
Joined: Thu 05 Jul 2007, 11:53

#7 Post by WarMocK »

*phew* It's been a while since I threw the original files out. Mind posting the code from defaultbrowser in here again for me? ;-)

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#8 Post by sc0ttman »

WarMocK wrote:*phew* It's been a while since I threw the original files out. Mind posting the code from defaultbrowser in here again for me? ;-)
It could be:

Code: Select all

#!/bin/sh
exec mozstart "$@"
Or:

Code: Select all

#!/bin/sh
exec firefox-bin "$@"
etc..

But the last line should always start with 'exec', and end with '"$@"'

I think the fastest and most efficient way to replace the command after 'exec' will be to totally replace the last line with another string (which can be hard coded) ..

Or ideally, replace only the stuff between 'exec' and '"$@"' but I'm too dumb to do it..
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
WarMocK
Posts: 169
Joined: Thu 05 Jul 2007, 11:53

#9 Post by WarMocK »

Code: Select all

OLDBROWSER="`cat defaultbroser | grep exec`"
Use this, then replace $OLDBROWSER with "exec $BROWSER "$@"" using sed.

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#10 Post by sc0ttman »

WarMocK wrote:

Code: Select all

OLDBROWSER="`cat defaultbroser | grep exec`"
Use this, then replace $OLDBROWSER with "exec $BROWSER "$@"" using sed.
Cheers.. Just realised this won't work for 'non-standard' defaultbrowser files.. (PuppyBrowser...)

I am gonna adapt your code and just delete everything after #!/bin/sh and append exec $BROWSER "$@" - as this command is the standard...

Thanks for your help. :D
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#11 Post by 01micko »

Hi sc0ttman

Nice job!

One thing.. put a comment at the top of the script saying "modded by sc0ttman on such and such date for whatever reason"
And probably should put a link to the gpl lisense and saying software is provided "as is", no warranty in the comment. Er, I should have done that!

I can't take all the credit.. :)

Cheers
Puppy Linux Blog - contact me for access

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#12 Post by sc0ttman »

Thanks 01micko...

I hope I'm not stepping on your toes, but I saw your work on this, and thought 'I gotta get me some of that.. for *my* next project..'

I'll add your suggestions, as a new tab, in the top row..

I'd like to add the following features/improvements as well:

- move browser packages (used in this app) from http://ppm.scottjarvis.com to public puppy server (anyone??...)
- Automatic re-creation of defaultbrowser and defaulthtmlviewer files
- Get email, flash and java links working

As a side note, I've often thought someone (with better skills than me) should write a function that can be used in the terminal, which easily updates the default*** files with the new value exec $APP "$@"

Something like:

Code: Select all

update-default [browser|htmlviewer|paint|etc] [command]
Examples:

Code: Select all

update-default -browser opera
update-default -spreadsheet calc
These would produce the lines exec opera "$@" in defaultbrowser and exec calc "$@" in defaultspreadsheet

Just a thought... Which should probably be posted elsewhere...
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#13 Post by 01micko »

I think pizzasgood has already made the default changer you are looking for...

If it's not on your system then I think it may be in DuDE by zigbert.

Hey, it's open source, everything is fair game.

Cheers
Puppy Linux Blog - contact me for access

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#14 Post by sc0ttman »

01micko wrote:I think pizzasgood has already made the default changer you are looking for...

Cheers
I saw that, and will test it out, but wondered if a simple commandline version was available?

I'd also like to have the browser-installer run fixmenus after installing the browser... but only if the browser was installed..

anyone know the best way to do this?
I'll have a go myself anyway.. but just asking

after petget finishes, i could check for the existence of certain file(s), and then run fixmenus if they were found...
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

default app changer

#15 Post by sc0ttman »

sc0ttman wrote:As a side note, I've often thought someone (with better skills than me) should write a function that can be used in the terminal, which easily updates the default*** files with the new value exec $APP "$@"
01micko wrote:I think pizzasgood has already made the default changer you are looking for...
I saw that, and will test it out, but wondered if a simple commandline version was available?
Well, now it is.. I created a simple script that changes the default*** to the command you enter

DEFAULT APP CHANGER is here
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#16 Post by sc0ttman »

updated... see main post
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

Post Reply