Release SnapSnap: Take easy screenshots (repo release)


gruso

thunderbox
Joined
Feb 28, 2008
Messages
7,461
Age
44
Location
Sydney, Australia
Website
pandorapress.net



SnapSnap is a screenshot utility, making use of the built in 'fbgrab' command. The installer copies a script to NAND, and sets up a hotkey to trigger screenshots (default is F10). An auto-timer utility is also included. Screenshots are saved to SD card.


Changes in 1.0.0.0:


- Added support for systems running from boot SD


Previous changes:

Release 0.1.2.1:


- Timer shooting added. Look for separate entry in Graphics menu.


- Detection of existing installs fixed.


(PND filename 0125 does not match version number... PXML fail, disregard.)


Release 0.1.1.1:


- Now removes all hotkeys on uninstall, including user created


- Better scripting (thanks Neelix)


Beta3:


-Now checks for screenshot folder before saving (no more 'file exists' error)


-Uninstaller now removes hotkey (default F10 only; does not remove custom hotkeys)


-Less intrusive install/uninstall notifications


-Misc. script tidying


Beta2:


- No longer saves images to NAND


- Automatic hotkey config on install


- Now capable of grabbing Notaz SDL apps, subject to limitations below

People upgrading from the previous version: Run the uninstaller, then the installer.


LIMITATIONS:


- The script should be capable of grabbing screens from any app, however hotkeys are not recognised by fullscreen SDL apps. Use the timer for this.


DOWNLOAD: http://repo.openpand...napsnap.install
 
Last edited by a moderator:

gruso

thunderbox
Joined
Feb 28, 2008
Messages
7,461
Age
44
Location
Sydney, Australia
Website
pandorapress.net
Not too much hassle involved, I just had to tweak some scripts already written by others, and throw them into a PND with this handy tool. :) It's a job that's been waiting for a packager for a couple of years now! Look forward to some feedback.


[edit] Just had a brief comment exchange with Skeezix which I'll share for anyone interested. The actual command used here (fbgrab) is included in the firmware (in fact this PND relies on it) but it has no hotkey assigned. If you wished, you could skip this PND and jump straight into setting up a keyboard shortcut for it. But then you'd have to add all the additional arguments - file name, location etc.


Hopefully I can refine this PND to the point where you never have to type anything or dig through a menu.
 
Last edited by a moderator:

TrashyMG

Sarcasm Dispenser
Staff member
Joined
Jan 18, 2010
Messages
10,954
Great!, can't wait to try it once my Pandora is back home.
 

milkshake

Advanced Member
Joined
May 18, 2009
Messages
3,735
Age
36
Location
Rotherham, UK
suggestion:


use a unity interface to either select where the file is saved to or to generate a config file in the app data dir that specifies where to save the file... better yet why not store all screenshots in $HOME or $PWD in the script which means they will be saved to the appdata folder for this pnd?
 

foxblock

Asleep
Joined
Jun 17, 2009
Messages
1,563
Location
Germany
Good job.


Though in my experience the hotkey does not fire for any full-screen SDL app (probably because SDL takes input focus), which is a shame as it would be incredible useful to make screenshots of full-screen apps, too (how else should you document your superior FMN score).


Dunno how one can work around that, though.
 
Last edited by a moderator:

gruso

thunderbox
Joined
Feb 28, 2008
Messages
7,461
Age
44
Location
Sydney, Australia
Website
pandorapress.net
suggestion:


use a unity interface to either select where the file is saved to or to generate a config file in the app data dir that specifies where to save the file... better yet why not store all screenshots in $HOME or $PWD in the script which means they will be saved to the appdata folder for this pnd?
I'm looking at options there. The Zenity stuff for a user determined folder looks kinda off-putting at first glance, but I may end up back there. I've just tested a version that creates a /screenshots folder on /media/mmcblk0p1 during install - which is well and good if you keep that card in.

I thought about appdata, but remember the PND is only for install, and the script runs from NAND. Remove the card you installed from, and there is no folder to save to.


Perhaps I just need my script to check SD1 for a screenshot folder, and create it if needed.


In other news, it now sets a hotkey on install.
 
Last edited by a moderator:

milkshake

Advanced Member
Joined
May 18, 2009
Messages
3,735
Age
36
Location
Rotherham, UK
yes it would need to be hard programmed into the system like the PNDkey hold down which allows to close pnd apps.
 

notaz

Certified Guru
Joined
Aug 23, 2005
Messages
4,913
Location
Lithuania
Website
notaz.gp2x.de
It uses the fbgrab command to dump screens. Note that due to this, it will not work in apps that use Notaz SDL.
You could use fbgrab -d /dev/fb1 to capture overlay, perhaps using another hotkey for this.


Or you could do something like this to detect if overlay is used:



Code:
if lsof /dev/fb1 > /dev/null; then

  fbgrab -d /dev/fb1 ...

else

  fbgrab ...

endif


Edit: maybe we should add this to default firmware, any idea for a hotkey? And where to save those screenshots?
 
Last edited by a moderator:

foxblock

Asleep
Joined
Jun 17, 2009
Messages
1,563
Location
Germany
Edit: maybe we should add this to default firmware, any idea for a hotkey? And where to save those screenshots?
Good idea.


I personally always set it to Ctrl+Shift+S, just because I know that's not used for anything else. A combination with the Pandora button would probably make sense (like Pandora+S), but could lead to problems in Minimenu.


For storing I would suggest checking whether an SD card is present, if so putting them in pandora/screenshots/ on the first found SD card - else HOME.


Or add a small helper-app to the settings, which sets some envar to the path you want to save the images to.
 

milkshake

Advanced Member
Joined
May 18, 2009
Messages
3,735
Age
36
Location
Rotherham, UK
i would suggest something that is easy to press whilst playing a game which "Ctrl+Shift+S" isnt really, maybe something like hold down the R or L button then press start or select or pandora button?


that way its easy to do whilst playing a game?

oh by the way PLEASE do add this to the default firmware thanks :)
 

gruso

thunderbox
Joined
Feb 28, 2008
Messages
7,461
Age
44
Location
Sydney, Australia
Website
pandorapress.net
Thanks Notaz :)


fbgrab -d /dev/fb1 works nicely. But as foxblock points out, hotkeys are not firing with fullscreen SDL apps running (well, I'm taking his word on the SDL part as I wouldn't know, but some allow it and some don't. Super Geometry Dust is one that does). I have captured some FBA games manually, with time delay:



Code:
fbgrab -s 30 -d /dev/fb1 ~/screen.png



Likewise I can capture Forget Me Not with a regular fbgrab:





Code:
fbgrab -s 30 ~/screen.png


Anyway, I will do a small update tomorrow with preconfigured hotkey and hopefully SD card saving. My current save path is /media/mmcblk0p1/screenshots, but I'm not sure if SD labels will prevent that working for some people. Some reading to do on that in the morning.
 
Last edited by a moderator:

foxblock

Asleep
Joined
Jun 17, 2009
Messages
1,563
Location
Germany
Anyway, I will do a small update tomorrow with preconfigured hotkey and hopefully SD card saving. My current save path is /media/mmcblk0p1/screenshots, but I'm not sure if SD labels will prevent that working for some people. Some reading to do on that in the morning.
That will most certainly not work for all people, with the path to my SD card being "/media/KARL/screenshots" for example :S
 

fusion_power

Advanced Member
Joined
Dec 25, 2005
Messages
13,134
Location
germany
Website
Visit site
Edit: maybe we should add this to default firmware, any idea for a hotkey? And where to save those screenshots?
I welcome this. :) Some basic Screenshot Hotkey would be enough for my needs. I never had much luck with command line scripts and such stuff. Integrated Screenshot function per Hotkey sureley would help me.
 

skeezix

Internal Development
Joined
Mar 11, 2003
Messages
8,064
Website
www.codejedi.com
We could slide it into pndevmapperd's config maybe so that it could take a snapshot even when SDL is up, but I like to minimize the number of things evmapperd worries about; still, it handle sthings like brightness up/down, so should be able to handle a snapper pretty easily


jeff
 

MarioPandio

Well-Known Member
Joined
Aug 28, 2010
Messages
1,378
Location
Half way up the stair
Nice project Gruso and good to see the additions for ingame shots being possible.


Here's an alternative to Milkshakes script for toggled continuous screenshots. (Not that theres anything wrong with his, just another way also provided priorly on the boards by LinuxMaster or someone not around anymore)






Code:
#!/bin/bash


PIDFILE=~/.snapsnap.pid

if [ -f $PIDFILE ]

then

  	kill $(cat $PIDFILE)

  	rm $PIDFILE

  	exit 0

else

   	echo $$ > $PIDFILE

fi;

i=1

while [ $i -le 24 ]

do

  	sleep 10

  	fbgrab /media/<SDCARDNAME>/<PATHTOFOLDERNAME>/screen`date +%y%m%d-%H%M%S`.png

  	notify-send <DESIREDONSCREENNOTIFICATION> $i

  	i=`expr $i + 1`

done


You just change the sleep value, notify-send name and the fbgrab /path. sudo chmod ugo+rwx <filename.sh> and sudo cp it to /usr/bin and once hotkeyed via <filename> as the command, it will switch it on/off.


As for milkshakes suggestion of ingame hotkeys being easy to reach, would Del+1 be any good, as various games will all have assignments to R L Start Select or Pandora button surely?


EDIT : To provide proper paste of code. Although tabbing is wrong as from a windows machine :(
 
Last edited by a moderator:
Top