The time now is Sat 18 May 2013, 03:43
All times are UTC - 4 |
|
Page 1 of 2 [16 Posts] |
Goto page: 1, 2 Next |
| Author |
Message |
sc0ttman

Joined: 16 Sep 2009 Posts: 2173 Location: UK
|
Posted: 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!!!!!!
| Description |
updated to new urls
|

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

Download |
| Filename |
browser-installer-pa.pet |
| Filesize |
86.54 KB |
| Downloaded |
408 Time(s) |
| Description |
screenshot |
| Filesize |
138.73 KB |
| Viewed |
2184 Time(s) |

|
_________________ 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
|
|
 |
sc0ttman

Joined: 16 Sep 2009 Posts: 2173 Location: UK
|
Posted: 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
|
|
 |
WarMocK

Joined: 05 Jul 2007 Posts: 169
|
Posted: 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.
|
|
Back to top
|
|
 |
sc0ttman

Joined: 16 Sep 2009 Posts: 2173 Location: UK
|
Posted: 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
|
|
 |
WarMocK

Joined: 05 Jul 2007 Posts: 169
|
Posted: 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
|
|
 |
sc0ttman

Joined: 16 Sep 2009 Posts: 2173 Location: UK
|
Posted: 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!!!
_________________ Akita Linux, VLC-GTK, Pup Search, Pup File Search
|
|
Back to top
|
|
 |
WarMocK

Joined: 05 Jul 2007 Posts: 169
|
Posted: 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?
|
|
Back to top
|
|
 |
sc0ttman

Joined: 16 Sep 2009 Posts: 2173 Location: UK
|
Posted: 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?  |
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
|
|
 |
WarMocK

Joined: 05 Jul 2007 Posts: 169
|
Posted: 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
|
|
 |
sc0ttman

Joined: 16 Sep 2009 Posts: 2173 Location: UK
|
Posted: 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.
_________________ Akita Linux, VLC-GTK, Pup Search, Pup File Search
|
|
Back to top
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 7015 Location: qld
|
Posted: 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..
Cheers
_________________ keep the faith .. 
|
|
Back to top
|
|
 |
sc0ttman

Joined: 16 Sep 2009 Posts: 2173 Location: UK
|
Posted: 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
|
|
 |
01micko

Joined: 11 Oct 2008 Posts: 7015 Location: qld
|
Posted: 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
_________________ keep the faith .. 
|
|
Back to top
|
|
 |
sc0ttman

Joined: 16 Sep 2009 Posts: 2173 Location: UK
|
Posted: 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
|
|
 |
sc0ttman

Joined: 16 Sep 2009 Posts: 2173 Location: UK
|
Posted: 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
|
|
 |
|
|
Page 1 of 2 [16 Posts] |
Goto page: 1, 2 Next |
|
|
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
|