I’ve been pulling my teeth out trying to find out a way to automatically save a screenshot to a folder by pressing a hotkey, and append a counter or timestamp to the end of the filename. I found this which works well
import -window root ~/screenshot.png
but I need a way to add a counter so that it doesnt constantly override the same file when I press the hotkey, but will save a new screenshot in the same folder.
I’ve been looking at bash commands and scripts for the past 3 hours but havent found it yet, and it seems like it should be an easy task to perform.
Help would be appreciated. Thanks!
P.S. Also, If I wanted to change the command for the print screen key <Print> from “ksnapshot” to this command, how would I write it?
On 08/11/2010 10:36 PM, Supreme1012 wrote:
>
> I’ve been pulling my teeth out trying to find out a way to automatically
> save a screenshot to a folder by pressing a hotkey, and append a counter
> or timestamp to the end of the filename. I found this which works well
>
> import -window root ~/screenshot.png
>
> but I need a way to add a counter so that it doesnt constantly override
> the same file when I press the hotkey, but will save a new screenshot in
> the same folder.
>
> I’ve been looking at bash commands and scripts for the past 3 hours but
> havent found it yet, and it seems like it should be an easy task to
> perform.
>
> Help would be appreciated. Thanks!
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
I’ve been tinkering and I found that date command, but everytime I include : in the name I end up with a 10.2 mb file. Replacing the “:” with something else seems to fix it
<quote source=“man import”>
By default, ‘file’ is written in the MIFF image format. To specify a
particular image format, precede the filename with an image format name
and a colon (i.e. ps:image) or specify the image type as the filename
suffix (i.e. image.ps). Specify ‘file’ as ‘-’ for standard input or output.
</quote>
Didn’t plan on that; good observation though.
Good luck.
On 08/12/2010 12:06 AM, Supreme1012 wrote:
>
> I’ve been tinkering and I found that date command, but everytime I
> include : in the name I end up with a 10.2 mb file. Replacing the “:”
> with something else seems to fix it
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
The original version I typed up used unixtime (seconds since the epoch, or
1970-01-01) instead of YYYY-MM-DD-HH:MM:SS but the way I made it is
more-intuitive for mere mortals. Using an alternate delimiter was a good
idea; if you don’t mind a big incrementing integer, one per second,
representing time you could just replace the date section with date +%s
and that will just give you seconds since 1970-01-01.
Good luck.
On 08/12/2010 08:05 AM, ab@novell.com wrote:
> Hmmm… quirks of the import command it would seem:
>
> <quote source=“man import”>
> By default, ‘file’ is written in the MIFF image format. To specify a
> particular image format, precede the filename with an image format name
> and a colon (i.e. ps:image) or specify the image type as the filename
> suffix (i.e. image.ps). Specify ‘file’ as ‘-’ for standard input or output.
> </quote>
>
> Didn’t plan on that; good observation though.
>
> Good luck.
>
>
>
>
>
> On 08/12/2010 12:06 AM, Supreme1012 wrote:
>
>> I’ve been tinkering and I found that date command, but everytime I
>> include : in the name I end up with a 10.2 mb file. Replacing the “:”
>> with something else seems to fix it
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
On 2010-08-12 06:36, Supreme1012 wrote:
>
> I’ve been pulling my teeth out trying to find out a way to automatically
> save a screenshot to a folder by pressing a hotkey, and append a counter
> or timestamp to the end of the filename.
Well, in Gnome the default capture screen button (prt-screen) does just that by default.
>:-)
–
Cheers / Saludos,
Carlos E. R.
(from 11.2 x86_64 “Emerald” GM (Elessar))