iw1
Posts: 47
Joined: Mon Oct 13, 2014 8:10 am

Configure default path for Scratch projects?

Wed Nov 16, 2016 10:28 pm

The default path for the menu option File > Open on the main window and for the My Projects option in the Open Project window is the same, namely, home/pi/Documents/Scratch Projects.
Is there an easy way to change one or both of these, say, to home/pi/Scratch - a folder which always seems to be created when Scratch is installed but seems not to be accessible from any of the clickable options? Having Scratch projects in the documents folder has always seemed inappropriate.
Also, would such a change, if made, survive a Scratch update?

Also, an observation of no functional importance or consequence: There seems to be an inconsistency in the folder indication box near the top of the Open Project window when it is opened by the File > Open (or Save or Save as) route. The full file path is made visible not, as might be expected, by clicking the down-arrow symbol, but by clicking on the space to the right of the down-arrow symbol. A redraw of the Open Project window by clicking on any of the button options in this window causes this space to disappear and clicking the down-arrow produces the expected response.

timrowledge
Posts: 1342
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Configure default path for Scratch projects?

Thu Nov 17, 2016 4:52 am

iw1 wrote:The default path for the menu option File > Open on the main window and for the My Projects option in the Open Project window is the same, namely, home/pi/Documents/Scratch Projects.
Is there an easy way to change one or both of these, say, to home/pi/Scratch - a folder which always seems to be created when Scratch is installed but seems not to be accessible from any of the clickable options?
As it happens, there is.

In your user home directory (i.e. /home/pi for almost everyone) create, if needed, a file called '.scratch.ini' and include the line

Code: Select all

home=/home/pi/Scratch
You may already have this file with, for example

Code: Select all

language=en
or other two-letter ISO code for language choice.

Next time you open Scratch your home directory should be set that way. Be warned - any spelling mistakes, references to incorrect paths etc might cause 'fun'.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

iw1
Posts: 47
Joined: Mon Oct 13, 2014 8:10 am

Re: Configure default path for Scratch projects?

Thu Nov 17, 2016 11:25 am

Thanks for the quick reply, Tim - and an easily implemented solution.
Is there a list somewhere of the other parameters - I have seen the posts referencing fontsize and soundbuffer - that can usefully be set in the .scratch.ini file?

Two observations made whilst moving the location of projects:
1. If it doesn't exist, a folder 'Scratch' seems to be created in /home/pi when Scratch is started. Why does this need to happen? It doesn't seem to get used for anything by default.

2. I noticed, for the first time, the presence of a .scratch directory in the home/pi directory. This in turn has a subdirectory, 'private', which is empty. Is there a reason why these are there?

timrowledge
Posts: 1342
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Configure default path for Scratch projects?

Thu Nov 17, 2016 8:40 pm

iw1 wrote:Thanks for the quick reply, Tim - and an easily implemented solution.
Is there a list somewhere of the other parameters - I have seen the posts referencing fontsize and soundbuffer - that can usefully be set in the .scratch.ini file?
There is supposed to be! But... I can't find it. Something to fix.
iw1 wrote:Two observations made whilst moving the location of projects:
1. If it doesn't exist, a folder 'Scratch' seems to be created in /home/pi when Scratch is started. Why does this need to happen? It doesn't seem to get used for anything by default.
Interesting. I would never notice this because I *always* make a Scratch directory and use it for all my Scratch development stuff. I'll look into it.
iw1 wrote:2. I noticed, for the first time, the presence of a .scratch directory in the home/pi directory. This in turn has a subdirectory, 'private', which is empty. Is there a reason why these are there?
Hmm, not on my machines. Weird.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

iw1
Posts: 47
Joined: Mon Oct 13, 2014 8:10 am

Re: Configure default path for Scratch projects?

Thu Nov 17, 2016 11:14 pm

Like the Scratch directory, the .scratch directory and its subdirectory mentioned above are created, if they don't exist, when Scratch is run.
Not worth wasting time on, but weird if it doesn't happen on your computer as it occurs on both my Pis (running up-to-date Jessie Pixel).

Return to “Scratch”