jishiha
Posts: 5
Joined: Mon Oct 21, 2013 2:11 am

Quesition about "Boot to Scratch" NOOBS OS

Mon Oct 21, 2013 2:23 am

Is there a way to open a specific scratch project at startup on "Boot to Scratch" NOOBS OS?

rdb
Posts: 294
Joined: Mon Jul 16, 2012 3:42 pm

Re: Quesition about "Boot to Scratch" NOOBS OS

Mon Oct 21, 2013 4:48 pm

Not at present without modification to some start-up scripts.

@asb should be able to better advise on this.

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Quesition about "Boot to Scratch" NOOBS OS

Mon Oct 21, 2013 4:56 pm

There does not seem to be a documented method of opening a project when starting Scratch from the command line, so it is not clear to me how this information could be used at system boot time.

(I've looked at man scratch and http://info.scratch.mit.edu/Network_Installation which is referenced by the manpage.)
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Quesition about "Boot to Scratch" NOOBS OS

Tue Oct 22, 2013 11:21 am

Although it is not documented, doing 'the obvious thing' seems to work -

Code: Select all

scratch Path/to/my_scratch_project.sb
does, as you might expect, open Scratch with the specified project open on the screen.

Of course, as it isn't documented this might not be supported and might cease to work at a future release without warning...

For implementation with NOOBS, might it be possible to have a little wrapper along the lines of -

Code: Select all

 if .exists. ~/Documents/Scratch Projects/my_default_project.sb :
    then run "scratch ~/Documents/Scratch Projects/my_default_project.sb"
 else:
   run "scratch"      # with no arguments
[That's my pseudo-code, not any known scripting language!]
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

jishiha
Posts: 5
Joined: Mon Oct 21, 2013 2:11 am

Re: Quesition about "Boot to Scratch" NOOBS OS

Sun Oct 27, 2013 1:46 pm

I found the solution.

My goal was to open a specific Scratch project at boot, and the solution below works.

Instead of using "Boot to Scratch", use the normal "Raspbian" option of NOOBS OS.

Then, open raspi-config by

# sudo raspi-config

and select "3. Enable Boot to Desktop/Scratch".

In the next boot options, select "Desktop Log in as user ‘pi’ at the graphical desktop".

Quit raspi-config, but do not reboot because there are more works to be done.


# sudo vi /etc/xdg/lxsession/LXDE/autostart

and edit the autostart script as below.

@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@xscreensaver -no-splash
@scratch presentation /home/pi/myproject.sb <== add this line


Now, reboot and desktop starts, then Scratch starts in presentation mode, and you get myproject.sb start automatically.

Return to “Advanced users”