Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 16 Sep 2014, 07:25
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Browsers and Internet
Browser Installer - choose your browser
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [16 Posts]   Goto page: 1, 2 Next
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Fri 16 Apr 2010, 08:22    Post subject:  Browser Installer - choose your browser
Subject description: (by 01micko originally...)
 

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!!!!!!
browser-installer-pa.pet
Description  updated to new urls
pet

 Download 
Filename  browser-installer-pa.pet 
Filesize  87.7 KB 
Downloaded  710 Time(s) 
browser-installer-pa.pet
Description  old version, links no longer work
pet

 Download 
Filename  browser-installer-pa.pet 
Filesize  86.54 KB 
Downloaded  538 Time(s) 
browser-installer.png
 Description   screenshot
 Filesize   138.73 KB
 Viewed   2431 Time(s)

browser-installer.png


_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Mon 17 May 2010, 17:34; edited 3 times in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Fri 16 Apr 2010, 10:08    Post subject:  

Possible improvements, that I wanna make:

- re-build the defaultbrowser file after each browser is installed, with the relevant command (help me please!)

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
WarMocK


Joined: 05 Jul 2007
Posts: 169

PostPosted: Fri 16 Apr 2010, 10:57    Post subject:  

sc0ttman,
you could use sed:
Code:

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. Wink
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Fri 16 Apr 2010, 15:30    Post subject:  

WarMocK wrote:
sc0ttman,
you could use sed:
Code:

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?

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
WarMocK


Joined: 05 Jul 2007
Posts: 169

PostPosted: Fri 16 Apr 2010, 16:47    Post subject:  

After reading out what browser was chosen:
Code:
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.
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Fri 16 Apr 2010, 16:57    Post subject:  

WarMocK wrote:
After reading out what browser was chosen:
Code:
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!!! Rolling Eyes

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
WarMocK


Joined: 05 Jul 2007
Posts: 169

PostPosted: Fri 16 Apr 2010, 17:26    Post subject:  

*phew* It's been a while since I threw the original files out. Mind posting the code from defaultbrowser in here again for me? Wink
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Fri 16 Apr 2010, 17:33    Post subject:  

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? Wink


It could be:
Code:
#!/bin/sh
exec mozstart "$@"

Or:
Code:
#!/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..

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
WarMocK


Joined: 05 Jul 2007
Posts: 169

PostPosted: Fri 16 Apr 2010, 17:52    Post subject:  

Code:
OLDBROWSER="`cat defaultbroser | grep exec`"


Use this, then replace $OLDBROWSER with "exec $BROWSER "$@"" using sed.
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Fri 16 Apr 2010, 18:12    Post subject:  

WarMocK wrote:
Code:
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. Very Happy

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7801
Location: qld

PostPosted: Sat 17 Apr 2010, 17:15    Post subject:  

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.. Smile

Cheers

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Sat 17 Apr 2010, 18:12    Post subject:  

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:
update-default [browser|htmlviewer|paint|etc] [command]


Examples:

Code:
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...

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7801
Location: qld

PostPosted: Sat 17 Apr 2010, 18:28    Post subject:  

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

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Sat 17 Apr 2010, 19:22    Post subject:  

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...

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2376
Location: UK

PostPosted: Sun 18 Apr 2010, 10:44    Post subject: default app changer
Subject description: default app changer script
 

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

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [16 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Browsers and Internet
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1074s ][ Queries: 13 (0.0195s) ][ GZIP on ]