Page 1 of 7

Take a Shot! - yet another screenshot utility...

Posted: Fri 22 Feb 2013, 17:15
by SFR
Yeah, I know - there's a lot of them already and it would be complete nonsense to write another, but this one was made due to specific need - to include mouse cursor into screenshot.
I found out that ffmpeg has such ability and it's already in many Puppies, so no external tools are required.

The interface isn't beautiful, but (hopefully) intuitive in use; just keep in mind a couple of things:
- selecting region is a bit unusual: click on top-left corner of desired area and release mouse button, then click again on bottom-right corner
- cursor won't be included into screenshot (and additionally ffmpeg may behave weird in some Puppies) if you have only 16bit color depth, must be 24bit (you can change it via xorgwizard)

Requirements: Bash, Gtkdialog >= 0.8.1, ffmpeg/avconv, xwininfo, getcurpos, awk, tr, gifsicle (optional), xrectsel (optional)

I tested it in: Slacko-5.4 (Compiz) + briefly, using VBox, in Slacko-5.4.0.3 (JWM), Lupu-528 (Openbox), Precise-5.4.2 (JWM) and Akita-14 (JWM/Xorg; ffmpeg segfaults with XVesa).
TAS is currently developed on Fatdog64.

PS. I wrote this tool primarily for myself and I don't know if ffmpeg is really wise choice for such a task, but so far works nice for me.
Anyway, I can't guarantee it'll work flawlessly in all cases. :wink:
______________

tas_NLS-1.15.pet contains the following translations:
- Polish (me)
- Spanish (nilsonmorales & vicmz) [needs updating]
- French (musher0 & charlie6) [needs updating]
- Dutch (Bert) [needs updating]
- Portuguese (vicmz) [needs updating]
- Italian (vicmz) [needs updating]
- German (L18L) [needs updating]
_______________

Changelog:

Version 1.1:
1.added dedicated icon (`f00).
2. removed "Open in default image..." checkbox from the main window.
3. added a new window that pops up after taking a shot, with the following options:
- View (via defaultimageviewer - usually Viewnior)
- Edit (via defaultimageeditor - usually MTPaint)
- Continue (go back to the main window)
- Exit
4. Some minor improvements.

Version 1.2:
- i18n (gettext)

Version 1.3:
- bugfix: filename with a colon in its name won't save onto FAT partition nor this forum (thanks to don570)

Version 1.4:
- output formats: removed - TGA, PCX, PPM; added - GIF
- added options to take sequence of snapshots
- 'Add datestamp' checkbox now adds only date
- new checkbox 'Add timestamp'
- program icon changed (/usr/local/lib/X11/mini-icons/mini-camera.xpm)
- lots of minor fixes

Version 1.5:
- bugfix: problems with GIFs in Wary (thanks to Geoffrey)

Version 1.6:
- fixed GIF looping issue in older versions of ffmpeg (thanks to Geoffrey)
- added "Scale" option
- added command-line option "quick", which instantly takes a snapshot of the entire screen
- some other fixes and internal improvements

Version 1.7:
- added tooltip that clarifies 'Window' and 'Region' modes
- when "Number of frames" = 1, "Frames per seconds" gets insensitive (works only if Gtkdialog >= 0.8.3)
- support for photocamera.svg icon from Woof-CE

Version 1.8:
- Added "Toggle extra options" togglebutton, which shows/hides "Number of frames" & "Frames per second" options
- Settings are retained also if TAS window has been closed without taking a screenshot
- Some minor fixes & changes

Version 1.9:
- compatibility with avconv

Version 1.10:
- possible fix for supposed avconv/ffmpeg clash (problem reported by Relztrah)
- fixed date/time stamps not being calculated correctly if DELAY and/or Window/Region modes has been used

Version 1.11:
- disabled beep for Quickshot (it's taken immediately, so there's no point to have it)
- added checkbox "Beep on Shot" (thanks to MochiMoppel)
- can use avplay/ffplay (they support more formats than aplay) as a player for BEEPFILE - aplay as a fallback
- standard beep command as a fallback, if /usr/share/audio/beep_high.wav doesn't exist (thanks to MochiMoppel)
- the default BEEPFILE as well as DEFAULTIMAGEVIEWER and DEFAULTIMAGEEDITOR can be specified in ~/.take_a_shot.rc config file (no need to edit the code anymore)
- added checkbox "Show timer" - it displays a timer in the center of the screen if DELAY > 0

Version 1.12:
- fix for different treatment of newline by 'read' cmd in Bash-4.4 (thanks to peebee & 01micko)
- fix for newer ffmpeg that does not recognize '+nomouse' option anymore
- can make use of xrectsel, if available
- ditched xmessage; everything's done in Gtkdialog now
- minor corrections/fixes

Version 1.13:
- removed 'Add datestamp' and 'Add timestamp' checkboxes; instead a user can freely insert date's % parameters into filename
- fix: some ancient versions of ffmpeg may not support '-draw_mouse' option
- minor corrections

Version 1.14:
- fix: replace slashes to underscores in filename after evaluating date format options (thanks to MrDuckGuy)

Version 1.15:
- added 'Discard' button to the preview dialog (thanks to MochiMoppel)
- increased the size of the preview image (1/5 -> 1/3)


Have fun &
Greetings!

Posted: Sat 23 Feb 2013, 20:19
by Eyes-Only
Thanks for making this SFR. True, as you've said there are already many of these floating about. But what I like about yours is the simplicity and the way it's set up. It has all the needed features I require - and none of the wasted fluff! 8) Too many times they're either far too simplistic or far too featureful. Yours is the perfect balance for all of my screenshot needs.

Thank you for creating and likewise sharing it! Very much appreciated by this fellow Puppian.

Cheers/Amicalement,

Eyes-Only
"L'Peau-Rouge d'Acadie"

Posted: Mon 25 Feb 2013, 05:24
by `f00
8) , my fluff fscap in wine doesn't quite do the cursors in linux - like Eyes-Only says, "perfect balance" in a good ui.
some 'pointers' @103k

(much prefer tas to the stock "screeny" on racy 5.4.91) - here's a dedicated icon..

Cursor on the screenhot : good idea !

Posted: Mon 25 Feb 2013, 06:57
by Pelo
Sure there are a lot of tools : here pupsnap

mtPaint make screenshots too.
File, new, screenshot.
or file, action, delayed screenshot
Is'nt it easy to affect screenshot keypad with this job ? Sometimes, i copy the program icon in the task bar (from usr/share/applications)

Posted: Mon 25 Feb 2013, 12:31
by SFR
Thanks guys! :)

And it's good to know that it works properly also for "external" world.

Greetings!

Posted: Tue 14 May 2013, 16:17
by Cadejo
This is awesome!!!!

I was using easy shot, but this is certainly easier!

Posted: Wed 22 May 2013, 16:06
by SFR
@Cadejo: Thanks, I'm glad you like it!

@`f00: Thanks for the icon, I haven't noticed it before!

New version (1.1) has been uploaded; see the first post for details.
Screenshots below...

I hope 1.0's simplicity/usability has been preserved in the new version..? :wink:

Greetings!

Posted: Sun 23 Jun 2013, 09:05
by musher0
Good morning, SFR.

Please find attached a French translation* of your very well made "Take A Shot!" utility.

Best regards.

musher0

~~~~~~~~~~~~~
* Corrected version is here: http://murga-linux.com/puppy/viewtopic. ... ost#709832

Posted: Sun 23 Jun 2013, 16:49
by SFR
Hey Musher0, thank you for translation.
FYI: you missed two spots @ lines 193 and 235. :wink:
However, I just gettext'ed TAS, so you can use MoManager now, if you'd like, then I could add your translation to tas_NLS.pet.
From my side I made PL.

First post updated.

Greetings!

Spanish locale

Posted: Sun 23 Jun 2013, 18:36
by nilsonmorales
check first please, .mo and .po files add

Posted: Sun 23 Jun 2013, 19:27
by SFR
Thanks, added to tas_NLS-1.2.pet.

Greetings!

Posted: Sun 23 Jun 2013, 21:11
by vicmz
Hello everyone

Good job Nilson! :D
I have attached a slightly reviewed version of your Spanish locale.

Thanks for this app, SFR. Now I can easily explain (without heavier programs) why I often translate 'cursor' as 'puntero' (the mouse pointer, see pictures below).

Posted: Sun 23 Jun 2013, 21:57
by Bert
and Dutch translation :wink:

(a bit off-topic: I have often wondered why nobody creates a screenshot tool that actually uses the 'printscreen' key...just one key to hit and presto...probably more difficult to implement than I imagine )

TAS works very well though!

Thank you SFR 8)

Posted: Sun 23 Jun 2013, 22:29
by nilsonmorales
thanks vicmz , you are correct my friend

Posted: Sun 23 Jun 2013, 22:55
by vicmz
Portuguese and Italian attached at the end of this message. :D
Bert wrote:a bit off-topic: I have often wondered why nobody creates a screenshot tool that actually uses the 'printscreen' key...just one key to hit and presto...probably more difficult to implement than I imagine
Not really off-topic, I think. I had the same question, too. Until Argolance developed a screenshot utility for ToOpPy that does use the Print Screen key, so our screenshot experts (01micko for screeny, SFR for TAS, Radky for PupSnap) could ask Argolance how he did it, if they want to include this feature in their utilities.

***EDIT***
Portuguese locale reviewed

Posted: Mon 24 Jun 2013, 00:15
by musher0
vicmz wrote:Hello everyone

Good job Nilson! :D
I have attached a slightly reviewed version of your Spanish locale.

Thanks for this app, SFR. Now I can easily explain (without heavier programs) why I often translate 'cursor' as 'puntero' (the mouse pointer, see pictures below).
Sorry if this is a bit off topic:
Strange, we don't seem to have the distinction in French, between pointer and cursor. The two terms seem to indicate the same thing.
http://www.wordreference.com/enfr/pointer

Anyway, I got to go finish the FR translation!

BFN.

musher0

Posted: Mon 24 Jun 2013, 00:21
by musher0
SFR wrote:Hey Musher0, thank you for translation.
FYI: you missed two spots @ lines 193 and 235. :wink:
However, I just gettext'ed TAS, so you can use MoManager now, if you'd like, then I could add your translation to tas_NLS.pet.
From my side I made PL.

First post updated.

Greetings!
Hi, SFR.

Thanks for your reply. Sorry for the oversights.

I do not know how to use MoManager, so this is a "straight"
French version, with the oversights corrected.

Have a great day!

musher0

Posted: Mon 24 Jun 2013, 01:04
by vicmz
Sorry, I had to review the Portuguese locale because of a translation mistake (see my former post). Anyway, Portuguese users can tell if there is anything else to correct. :wink:
musher0 wrote: Sorry if this is a bit off topic:
Strange, we don't seem to have the distinction in French, between pointer and cursor. The two terms seem to indicate the same thing.
http://www.wordreference.com/enfr/pointer
A pointer is a cursor, too. The difference is that the text cursor shows where you are typing, and the mouse pointer shows where you are touching. It's a useful distinction because a pointer can do much more (open/close, turn on/off, drag and drop, select, etc.).

As for the distinction in French language:
Wikipédia wrote:Les ordinateurs actuels disposent souvent d'une interface graphique avec un deuxième curseur (appelé aussi pointeur) qui est piloté par un dispositif de pointage (le plus souvent une souris mais il peut aussi s'agir d'un Touchpad, d'un Trackball ou autre). Sur la plupart des ordinateurs ce pointeur est représenté par une flèche incliné vers la gauche, tandis que le curseur pour le texte est représenté par une barre verticale.
http://fr.wikipedia.org/wiki/Curseur_(i ... e_pointage

Posted: Mon 24 Jun 2013, 09:26
by SFR
Thanks - you're fantastic, guys!! :D
All added.

@Musher0: I made tas.mo file out of your translation, please check if everything's ok.
________________
vicmz wrote:
Bert wrote:a bit off-topic: I have often wondered why nobody creates a screenshot tool that actually uses the 'printscreen' key...just one key to hit and presto...probably more difficult to implement than I imagine
Not really off-topic, I think. I had the same question, too. Until Argolance developed a screenshot utility for ToOpPy that does use the Print Screen key, so our screenshot experts (01micko for screeny, SFR for TAS, Radky for PupSnap) could ask Argolance how he did it, if they want to include this feature in their utilities.
Yep, that's a hard one...
I don't know any pure, universal method to bind a key independently of current window manager.
As far as I can tell Argolance in his EasyShot (you meant that one, Vic?) has modified jwmrc-personal.
Similarily, in Slacko there's <Key keycode="111">exec:screeny</Key>.
Alas, these will work only in JWM...

Another way is to use xbindkeys, which makes the whole thing independent of current WM, but then again xbindkeys won't work if any menu is opened!

Eventually, one can use a dirty, lowest-level method like this:

Code: Select all

while :; do sleep 0.1; [ "`dd if=/dev/input/event0 bs=16 count=1 2>/dev/null | hexdump | cut -f8 -d ' ' | head -1`" = "00b7" ] && mtpaint -s; done
/dev/input/event0 = keyboard device (eventX may vary)
00b7 = PrtSc raw code (also may vary)
mtpaint -s = screenshot of the whole screen


Once launched, it should detect PrtSc in every (hopefully) circumstances...

Thanks again &
Greetings!

Posted: Mon 24 Jun 2013, 10:32
by musher0
You are too modest! Code corrected... :)

Code: Select all

while :; do sleep 0.1; [ "`dd if=/dev/input/event0 bs=16 count=1 2>/dev/null | hexdump | cut -f8 -d ' ' | head -1`" = "00b7" ] && tas; done