Author Topic: Scrot - the way you want it.  (Read 1167 times)

Sector11

  • Posts: 870
    • View Profile
Scrot - the way you want it.
« on: April 06, 2013, 06:00:25 PM »
I recently took three screenshots of a screenshot downloading; when it started, in the middle and when it ended and looked at them:

  • 2013-04-06--1365263953_1920x1080_scrot.png
  • 2013-04-06--1365264079_1920x1080_scrot.png
  • 2013-04-06--1365264093_1920x1080_scrot.png


And it struck me - what the hell are those 136526**** numbers.  Looking at scrots manpage I see it's the size of the image in "bytes" do I really need that?

Quote
       $f image path/filename (ignored when used in the filename)
       $n image name (ignored when used in the filename)
       $s image size (bytes) (ignored when used in the filename)
       $p image pixel size
       $w image width
       $h image height
       $t image format
       $$ prints a literal '$'
       \n prints a newline (ignored when used in the filename)

In my OpenBox menu for "Now" I use scrot like this:
Code: [Select]
scrot '%Y-%m-%d--%s_$wx$h_scrot.png' -e 'mv $f ~/images/ & gthumb ~/images/$f'
and again the manpage:
Quote
Characters preceded by a '%' are interpretted by strftime(2).

AHA!

%Y-%m-%d can be reduced to %F
and then add:
%T = HH:MM:SS

I like that better ... $hx$w is good then end with _Sector11.png and I have:
Code: [Select]
%F_%T_$wx$h_Sector11.png
and I get:
2013-04-06_14:46:28_1920x1080_Sector11.png

Much better:  date-time-size-and by who:
  • 2013-04-06_14:52:27_1920x1080_Sector11.png
  • 2013-04-06_14:52:48_1920x1080_Sector11.png
  • 2013-04-06_14:54:29_1920x1080_Sector11.png
OK, that's an opinion.

strftime info attached as a text file for reference.
Stay Home