[Pharo-project] Startup Preferences
Hi guys, I did a little project which allow you to save a st script on your HDD in a preference folder (~/.pharo#{version} for unix based machine, not yet defined for windows) and run it each time an image is open. You can also decide for each item if you want it to be run each time or only once. I use it to set my author name, change the fonts, set some settings, add my password in some repo etc The code is here: Gofer new squeaksource: 'StartupPreferences'; package: 'StartupPreferences'; load. You can have a look at StartupLoader class>>#example and StartupLoader class>>#example2 If you have comments or ideas (by example, what is the path for preferences on windows ? ^^), you're welcome :) Ben
thanks ben I will wait for feedback before pushing that in the system but indeed, I'm tired to always type my password in all the images. For script loader I did a hack but it would be better to have something nicer like what you did. Stef On Nov 19, 2011, at 2:13 PM, Benjamin wrote:
Hi guys,
I did a little project which allow you to save a st script on your HDD in a preference folder (~/.pharo#{version} for unix based machine, not yet defined for windows) and run it each time an image is open. You can also decide for each item if you want it to be run each time or only once.
I use it to set my author name, change the fonts, set some settings, add my password in some repo etc
The code is here:
Gofer new squeaksource: 'StartupPreferences'; package: 'StartupPreferences'; load.
You can have a look at StartupLoader class>>#example and StartupLoader class>>#example2
If you have comments or ideas (by example, what is the path for preferences on windows ? ^^), you're welcome :)
Ben
FWIW, I thought there is a way to put a preferences file in the image directory to achieve this?? I read that somewhere, I just never tried it. I typically use an image for a long time (still using 1.1.1 at the moment - it WORKS, ok<g>), so the prompts are perhaps less annoying to me than they would be to frequent image builders. Bill ________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] on behalf of Stéphane Ducasse [stephane.ducasse@inria.fr] Sent: Saturday, November 19, 2011 11:01 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Startup Preferences thanks ben I will wait for feedback before pushing that in the system but indeed, I'm tired to always type my password in all the images. For script loader I did a hack but it would be better to have something nicer like what you did. Stef On Nov 19, 2011, at 2:13 PM, Benjamin wrote:
Hi guys,
I did a little project which allow you to save a st script on your HDD in a preference folder (~/.pharo#{version} for unix based machine, not yet defined for windows) and run it each time an image is open. You can also decide for each item if you want it to be run each time or only once.
I use it to set my author name, change the fonts, set some settings, add my password in some repo etc
The code is here:
Gofer new squeaksource: 'StartupPreferences'; package: 'StartupPreferences'; load.
You can have a look at StartupLoader class>>#example and StartupLoader class>>#example2
If you have comments or ideas (by example, what is the path for preferences on windows ? ^^), you're welcome :)
Ben
The problem is when you download 4-5 images per day, each in a different folder :) Ben On Nov 19, 2011, at 6:02 PM, Schwab,Wilhelm K wrote:
FWIW, I thought there is a way to put a preferences file in the image directory to achieve this?? I read that somewhere, I just never tried it. I typically use an image for a long time (still using 1.1.1 at the moment - it WORKS, ok<g>), so the prompts are perhaps less annoying to me than they would be to frequent image builders.
Bill
________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] on behalf of Stéphane Ducasse [stephane.ducasse@inria.fr] Sent: Saturday, November 19, 2011 11:01 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Startup Preferences
thanks ben
I will wait for feedback before pushing that in the system but indeed, I'm tired to always type my password in all the images. For script loader I did a hack but it would be better to have something nicer like what you did.
Stef
On Nov 19, 2011, at 2:13 PM, Benjamin wrote:
Hi guys,
I did a little project which allow you to save a st script on your HDD in a preference folder (~/.pharo#{version} for unix based machine, not yet defined for windows) and run it each time an image is open. You can also decide for each item if you want it to be run each time or only once.
I use it to set my author name, change the fonts, set some settings, add my password in some repo etc
The code is here:
Gofer new squeaksource: 'StartupPreferences'; package: 'StartupPreferences'; load.
You can have a look at StartupLoader class>>#example and StartupLoader class>>#example2
If you have comments or ideas (by example, what is the path for preferences on windows ? ^^), you're welcome :)
Ben
Ben, Whatever you, Stef and others find helpful is fine by me. My guess would be that having one extra settings file to copy would be a minor hassle compared to providing sources (or symlink to same), a vm, and probably a shell script to make the thing go. Put another way, what do you do to make using "random" images so easy that copying a file is a big pain? I'm missing out on something :) Bill ________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] on behalf of Benjamin [benjamin.vanryseghem.pharo@gmail.com] Sent: Saturday, November 19, 2011 1:20 PM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Startup Preferences The problem is when you download 4-5 images per day, each in a different folder :) Ben On Nov 19, 2011, at 6:02 PM, Schwab,Wilhelm K wrote:
FWIW, I thought there is a way to put a preferences file in the image directory to achieve this?? I read that somewhere, I just never tried it. I typically use an image for a long time (still using 1.1.1 at the moment - it WORKS, ok<g>), so the prompts are perhaps less annoying to me than they would be to frequent image builders.
Bill
________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] on behalf of Stéphane Ducasse [stephane.ducasse@inria.fr] Sent: Saturday, November 19, 2011 11:01 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Startup Preferences
thanks ben
I will wait for feedback before pushing that in the system but indeed, I'm tired to always type my password in all the images. For script loader I did a hack but it would be better to have something nicer like what you did.
Stef
On Nov 19, 2011, at 2:13 PM, Benjamin wrote:
Hi guys,
I did a little project which allow you to save a st script on your HDD in a preference folder (~/.pharo#{version} for unix based machine, not yet defined for windows) and run it each time an image is open. You can also decide for each item if you want it to be run each time or only once.
I use it to set my author name, change the fonts, set some settings, add my password in some repo etc
The code is here:
Gofer new squeaksource: 'StartupPreferences'; package: 'StartupPreferences'; load.
You can have a look at StartupLoader class>>#example and StartupLoader class>>#example2
If you have comments or ideas (by example, what is the path for preferences on windows ? ^^), you're welcome :)
Ben
I always build everything from a new image. It is my process. and I try to throw away images as fast as I can (but not fast enough⦠when I see all the images I have around :). On Nov 19, 2011, at 6:02 PM, Schwab,Wilhelm K wrote:
FWIW, I thought there is a way to put a preferences file in the image directory to achieve this?? I read that somewhere, I just never tried it. I typically use an image for a long time (still using 1.1.1 at the moment - it WORKS, ok<g>), so the prompts are perhaps less annoying to me than they would be to frequent image builders.
Bill
________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] on behalf of Stéphane Ducasse [stephane.ducasse@inria.fr] Sent: Saturday, November 19, 2011 11:01 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] Startup Preferences
thanks ben
I will wait for feedback before pushing that in the system but indeed, I'm tired to always type my password in all the images. For script loader I did a hack but it would be better to have something nicer like what you did.
Stef
On Nov 19, 2011, at 2:13 PM, Benjamin wrote:
Hi guys,
I did a little project which allow you to save a st script on your HDD in a preference folder (~/.pharo#{version} for unix based machine, not yet defined for windows) and run it each time an image is open. You can also decide for each item if you want it to be run each time or only once.
I use it to set my author name, change the fonts, set some settings, add my password in some repo etc
The code is here:
Gofer new squeaksource: 'StartupPreferences'; package: 'StartupPreferences'; load.
You can have a look at StartupLoader class>>#example and StartupLoader class>>#example2
If you have comments or ideas (by example, what is the path for preferences on windows ? ^^), you're welcome :)
Ben
Very good idea indeed. I'm just concerned about the directory location: On Sat, Nov 19, 2011 at 2:13 PM, Benjamin <benjamin.vanryseghem.pharo@gmail.com> wrote:
~/.pharo#{version}
what about using the freedesktop.org specification of using $HOME/.config to put configuration files? What about having the #{version} as a subdirectory? That would result in something like: ~/.config/pharo/#{version}/ Also, it could be interesting to load all files in ~/.config/pharo/general/, whatever the version of Pharo. This would be useful to set passwords for example. The specification is at http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#varia... -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
yeah... the repository cache could be defaulted to there too El 21/11/2011, a las 4:53a.m., Damien Cassou escribió:
Very good idea indeed. I'm just concerned about the directory location:
On Sat, Nov 19, 2011 at 2:13 PM, Benjamin <benjamin.vanryseghem.pharo@gmail.com> wrote:
~/.pharo#{version}
what about using the freedesktop.org specification of using $HOME/.config to put configuration files? What about having the #{version} as a subdirectory? That would result in something like:
~/.config/pharo/#{version}/
Also, it could be interesting to load all files in ~/.config/pharo/general/, whatever the version of Pharo. This would be useful to set passwords for example.
The specification is at http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#varia...
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
I definitively think that you should have a kind of preference folder, because we want to have some information centralized The cache may be a good example, startup scripts, and probably more stuff :) On Nov 21, 2011, at 1:05 PM, Esteban Lorenzano wrote:
yeah... the repository cache could be defaulted to there too
El 21/11/2011, a las 4:53a.m., Damien Cassou escribió:
Very good idea indeed. I'm just concerned about the directory location:
On Sat, Nov 19, 2011 at 2:13 PM, Benjamin <benjamin.vanryseghem.pharo@gmail.com> wrote:
~/.pharo#{version}
what about using the freedesktop.org specification of using $HOME/.config to put configuration files?
Why not :) When I choose the path, I was thinking of my linux distrib, with all the ~/.applicationName folders :) I can easily be changed, and that's also why I sent this mail. To discuss about what is a good name for this folder :)
What about having the #{version} as a subdirectory? That would result in something like:
~/.config/pharo/#{version}/
Also, it could be interesting to load all files in ~/.config/pharo/general/, whatever the version of Pharo. This would be useful to set passwords for example.
The specification is at http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#varia...
I just pushed a new version when scripts are from ~/.config/pharo/#{version}/startup.st or ~/.config/pharo/general/* Like that, you have the local script for each version + the general scripts from the general directory. Tomorrow I will add more examples (and probably a way to set the name of general scripts). Ben
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
damien Depending on the version I have different passwords so does general handle that? Stef
Very good idea indeed. I'm just concerned about the directory location:
On Sat, Nov 19, 2011 at 2:13 PM, Benjamin <benjamin.vanryseghem.pharo@gmail.com> wrote:
~/.pharo#{version}
what about using the freedesktop.org specification of using $HOME/.config to put configuration files? What about having the #{version} as a subdirectory? That would result in something like:
~/.config/pharo/#{version}/
The specification is at http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html#varia...
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
On Mon, Nov 21, 2011 at 7:07 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Depending on the version I have different passwords so does general handle that?
'general' is for scripts that do not change between versions :-) -- Damien Cassou http://damiencassou.seasidehosting.st "Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
Hi Ben. Nice idea. One small feedback: try to use blocks for the items rather than strings :) cheers On Mon, Nov 21, 2011 at 3:36 PM, Damien Cassou <damien.cassou@gmail.com>wrote:
On Mon, Nov 21, 2011 at 7:07 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Depending on the version I have different passwords so does general handle that?
'general' is for scripts that do not change between versions :-)
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
-- Mariano http://marianopeck.wordpress.com
On Nov 22, 2011, at 6:03 PM, Mariano Martinez Peck wrote:
Hi Ben. Nice idea. One small feedback: try to use blocks for the items rather than strings :)
Why ?
cheers
On Mon, Nov 21, 2011 at 3:36 PM, Damien Cassou <damien.cassou@gmail.com> wrote: On Mon, Nov 21, 2011 at 7:07 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Depending on the version I have different passwords so does general handle that?
'general' is for scripts that do not change between versions :-)
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
-- Mariano http://marianopeck.wordpress.com
On Tue, Nov 22, 2011 at 2:36 PM, Benjamin < benjamin.vanryseghem.pharo@gmail.com> wrote:
On Nov 22, 2011, at 6:03 PM, Mariano Martinez Peck wrote:
Hi Ben. Nice idea. One small feedback: try to use blocks for the items rather than strings :)
Why ?
1) It is difficult to scape when you use simple quote ' . Hence, it is difficult to write your items. 2) There is no color highlighting ;) 3) When you save the method, strings are not compiled. If you use blocks, you can at least avoid compilation errors. 4) Because at the end what you put in those strings is code, hence, closures are a more accurate reification than string. 5) Strings are now well managed by the system when code is inside. For example, searching senders or refactoring tools wont work with code inside strings, but they do work with closures. Maybe there are more reasons, but I am lazy to think more. Cheers
cheers
On Mon, Nov 21, 2011 at 3:36 PM, Damien Cassou <damien.cassou@gmail.com>wrote:
On Mon, Nov 21, 2011 at 7:07 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Depending on the version I have different passwords so does general handle that?
'general' is for scripts that do not change between versions :-)
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
I agree that right now it's quite hard to write it by hand, but a UI will be done soon, so you will have colors and no problem with quotes. The problem with blocs is that you will retrieve a string from UI, so it's a bit hard to convert it into a block (at least, I do not know how to did it properly ^^) So maybe I should have both ;) Ben On Nov 22, 2011, at 6:42 PM, Mariano Martinez Peck wrote:
On Tue, Nov 22, 2011 at 2:36 PM, Benjamin <benjamin.vanryseghem.pharo@gmail.com> wrote:
On Nov 22, 2011, at 6:03 PM, Mariano Martinez Peck wrote:
Hi Ben. Nice idea. One small feedback: try to use blocks for the items rather than strings :)
Why ?
1) It is difficult to scape when you use simple quote ' . Hence, it is difficult to write your items. 2) There is no color highlighting ;) 3) When you save the method, strings are not compiled. If you use blocks, you can at least avoid compilation errors. 4) Because at the end what you put in those strings is code, hence, closures are a more accurate reification than string. 5) Strings are now well managed by the system when code is inside. For example, searching senders or refactoring tools wont work with code inside strings, but they do work with closures.
Maybe there are more reasons, but I am lazy to think more.
Cheers
cheers
On Mon, Nov 21, 2011 at 3:36 PM, Damien Cassou <damien.cassou@gmail.com> wrote: On Mon, Nov 21, 2011 at 7:07 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Depending on the version I have different passwords so does general handle that?
'general' is for scripts that do not change between versions :-)
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
On Tue, Nov 22, 2011 at 4:57 PM, Benjamin < benjamin.vanryseghem.pharo@gmail.com> wrote:
I agree that right now it's quite hard to write it by hand, but a UI will be done soon, so you will have colors and no problem with quotes.
The problem with blocs is that you will retrieve a string from UI, so it's a bit hard to convert it into a block (at least, I do not know how to did it properly ^^) So maybe I should have both ;)
I don't think a UI for that is worth it.
Ben
On Nov 22, 2011, at 6:42 PM, Mariano Martinez Peck wrote:
On Tue, Nov 22, 2011 at 2:36 PM, Benjamin < benjamin.vanryseghem.pharo@gmail.com> wrote:
On Nov 22, 2011, at 6:03 PM, Mariano Martinez Peck wrote:
Hi Ben. Nice idea. One small feedback: try to use blocks for the items rather than strings :)
Why ?
1) It is difficult to scape when you use simple quote ' . Hence, it is difficult to write your items. 2) There is no color highlighting ;) 3) When you save the method, strings are not compiled. If you use blocks, you can at least avoid compilation errors. 4) Because at the end what you put in those strings is code, hence, closures are a more accurate reification than string. 5) Strings are now well managed by the system when code is inside. For example, searching senders or refactoring tools wont work with code inside strings, but they do work with closures.
Maybe there are more reasons, but I am lazy to think more.
Cheers
cheers
On Mon, Nov 21, 2011 at 3:36 PM, Damien Cassou <damien.cassou@gmail.com>wrote:
On Mon, Nov 21, 2011 at 7:07 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Depending on the version I have different passwords so does general handle that?
'general' is for scripts that do not change between versions :-)
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
Done, the new version accept now string or bloc as code :) Ben On Nov 22, 2011, at 9:01 PM, Mariano Martinez Peck wrote:
On Tue, Nov 22, 2011 at 4:57 PM, Benjamin <benjamin.vanryseghem.pharo@gmail.com> wrote: I agree that right now it's quite hard to write it by hand, but a UI will be done soon, so you will have colors and no problem with quotes.
The problem with blocs is that you will retrieve a string from UI, so it's a bit hard to convert it into a block (at least, I do not know how to did it properly ^^) So maybe I should have both ;)
I don't think a UI for that is worth it.
Ben
On Nov 22, 2011, at 6:42 PM, Mariano Martinez Peck wrote:
On Tue, Nov 22, 2011 at 2:36 PM, Benjamin <benjamin.vanryseghem.pharo@gmail.com> wrote:
On Nov 22, 2011, at 6:03 PM, Mariano Martinez Peck wrote:
Hi Ben. Nice idea. One small feedback: try to use blocks for the items rather than strings :)
Why ?
1) It is difficult to scape when you use simple quote ' . Hence, it is difficult to write your items. 2) There is no color highlighting ;) 3) When you save the method, strings are not compiled. If you use blocks, you can at least avoid compilation errors. 4) Because at the end what you put in those strings is code, hence, closures are a more accurate reification than string. 5) Strings are now well managed by the system when code is inside. For example, searching senders or refactoring tools wont work with code inside strings, but they do work with closures.
Maybe there are more reasons, but I am lazy to think more.
Cheers
cheers
On Mon, Nov 21, 2011 at 3:36 PM, Damien Cassou <damien.cassou@gmail.com> wrote: On Mon, Nov 21, 2011 at 7:07 PM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Depending on the version I have different passwords so does general handle that?
'general' is for scripts that do not change between versions :-)
-- Damien Cassou http://damiencassou.seasidehosting.st
"Lambdas are relegated to relative obscurity until Java makes them popular by not having them." James Iry
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
-- Mariano http://marianopeck.wordpress.com
participants (6)
-
Benjamin -
Damien Cassou -
Esteban Lorenzano -
Mariano Martinez Peck -
Schwab,Wilhelm K -
Stéphane Ducasse