PeterPi09
Posts: 11
Joined: Mon Dec 31, 2012 2:03 am

Scratch Screen Saver Project

Tue Jan 01, 2013 5:52 pm

I am kind of new to programming so I decided my first scratch project would be a screen saver. I took 6 tennis ball scripts and have them bouncing around the screen by using the glide feature. How can I make this my actual screen saver for the raspi?

Thanks,
Peter Kaminski

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Scratch Screen Saver Project

Wed Jan 09, 2013 7:40 am

Nothing is usually impossible in the computing world but your request would be strong contender for that description :(

It would be a very challenging project for an advanced programmer !

:(

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

MightyMat
Posts: 3
Joined: Sun Jan 06, 2013 4:33 pm

Re: Scratch Screen Saver Project

Tue Jan 15, 2013 9:00 pm

The only thing you could do is to switch to your scratch program when you stop using your computer for a bit. Sorry I couldn't be much help :(

simplesi
Posts: 2327
Joined: Fri Feb 24, 2012 6:19 pm
Location: Euxton, Lancashire, UK
Contact: Website

Re: Scratch Screen Saver Project

Tue Jan 15, 2013 9:56 pm

i like your out-of-the-box thinking there :)

Simon
Seeking help with Scratch and I/O stuff for Primary age children
http://cymplecy.wordpress.com/ @cymplecy on twitter

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Scratch Screen Saver Project

Wed Jan 16, 2013 10:58 am

Hmm, I wonder if this 'screensaver module' can be any executable file http://www.dis.uniroma1.it/~liberato/screensaver/ (http://www.dis.uniroma1.it/~liberato/sc ... stall.html)?

...maybe it could be a shell script that starts the Scratch app? Or in the worst case it could be a simple C program that starts Scratch... A pity I don't have my RPi at hand to test :oops:
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

NathanBookham
Posts: 64
Joined: Sat Dec 15, 2012 9:18 am

Re: Scratch Screen Saver Project

Wed Jan 23, 2013 9:12 am

I have a funny feeling that Scratch has a command line argument that opens a project in fullscreen. Hopefully you can pass this on to the screensaver application.
This account is now inactive.
I am now known as 'InverseSandwich'

User avatar
DavidS
Posts: 4334
Joined: Thu Dec 15, 2011 6:39 am
Location: USA
Contact: Website

Re: Scratch Screen Saver Project

Wed Jan 23, 2013 2:06 pm

Just create an application directory containing only an obey script named !Run that invokes Scratch to run your Scratch script full screen, then put it in the "$.!Boot.RO500Hook.Res.Configure.ScrSavers" directory.
An application directory is just a normal directory that begins with a pling '!' charactor. You have probably noticed that most programms have this form to there name, most of them are actually application directories that contain the program along with any resources (including the applications icon sprite).
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers. Most of the rest from RISC OS on RPi 2B/3B/3B+ computers

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Scratch Screen Saver Project

Wed Jan 23, 2013 2:39 pm

DavidS wrote:Just create an application directory containing only an obey script named !Run that invokes Scratch to run your Scratch script full screen, then put it in the "$.!Boot.RO500Hook.Res.Configure.ScrSavers" directory.
An application directory is just a normal directory that begins with a pling '!' charactor. You have probably noticed that most programms have this form to there name, most of them are actually application directories that contain the program along with any resources (including the applications icon sprite).
Nice one ...provided that one is running RISCOS ;)
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: Scratch Screen Saver Project

Fri Jan 25, 2013 10:50 am

-rst- wrote:Hmm, I wonder if this 'screensaver module' can be any executable ...
Yes, it seems so ...in Linux that is.

I tested this yesterday ...with varying results and issues depending on the executable... (not a good idea to run a 'plain frame buffer' app that changes display resolution :oops: ) - prepare to have to swing your mouse around the desktop and maximise+normalise some window to get X to redraw the desktop :mrgreen:

Steps:
- check if screensaver already installed in LXDE, is "menu -> Preferences -> Screensaver" present
- if not installed: sudo apt-get install xscreensaver
- create file ~/.xscreensaver (that is a file named ".xscreensaver" in the user's home directory, '/home/pi' by default)
- add this line in the file:
programs: myownscreensaver
- restart X (close X and 'startx' ...not sure how this works if you have 'autostart X' enabled - might need to boot)
- go to: menu -> Preferences -> Screensaver
- find the 'myownscreensaver' in list of scrteensaver modules and select
- click 'Settings...' and in the settings popup 'Advanced >>>'
- edit command line to point to your executable

Scratch projects can be run in 'fullscreen' autorun 'presentation' mode using (this would go to the command line above):

scratch presentation path-to/filename.sb

...something along:

scratch presentation "/home/pi/Documents/Scratch Projects/Test.sb"

...best to test first from Run command-box (Alt+F2) or from LXTerminal.

So, if you are desp...determined enough to want to try this :lol:
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

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

Re: Scratch Screen Saver Project

Sat Aug 31, 2013 5:24 pm

Hmm, this would be an interesting project to make properly integrated into the desktop. There is presumably some hook, vector, signal, call, or whatever that is used to let the desktop know that it is time to start the screensaver; if that is so then in principle we could enhance the Squeak/Scratch code to recognise that and activate you project. You'd also need to handle whatever signal is used to stop the screen saver and return to the desktop.

The *nix Squeak vm has some mechanisms already in place to deal with at least a few OS signals so it might not be terribly difficult once the interface to the desktop is known.

It would probably be easier as a deployment exercise to take the algorithms for your bouncy-balls and simply use them in a full Squeak image to drive seem Morphs around; that way you'd drop the Scratch overhead (it does a *lot* of stuff under the covers and for a relatively simple animation it can cost a goodly amount of time - I'm gradually reducing that but it's hard word!) and would be able to use any screen resolution you like.

Find out those interfaces to the screensaver first; there really ought to be clean api in there somewhere!
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

Return to “Scratch”