resurrecting-open-source-projects / scrot

SCReenshOT - command line screen capture utility
Other
510 stars 50 forks source link

Is there any way to include the window name in the screenshot file name? #384

Closed rootexpression closed 2 months ago

rootexpression commented 2 months ago

I've been trying at this for a while, but all of the solutions use the now depreciated note option. To clarify, this is taking a screenshot of the window currently with focus, and appending its title to the file name.

This is something that'd help a lot in sorting screenshots, and finding "that one" you needed.

N-R-K commented 2 months ago

but all of the solutions use the now depreciated note option

Can you show an example of this? The note option draws text on the screenshot, it doesn't do any file renaming, so I'm not sure how it's solving your issue here.

N-R-K commented 2 months ago

To clarify, this is taking a screenshot of the window currently with focus, and appending its title to the file name.

The W specifier should do what you're looking for, based on this description. E.g (single quote around the filename is important to avoid shell interpreting $W as a variable):

$ scrot -u 'shot $W.png'

See the manpage for more special specifies in filenames like this.

(I'm not sure how or where the note option is coming into play here. These special specifiers aren't tied to note option.)

rootexpression commented 2 months ago

To clarify, this is taking a screenshot of the window currently with focus, and appending its title to the file name.

The W specifier should do what you're looking for, based on this description. E.g (single quote around the filename is important to avoid shell interpreting $W as a variable):

$ scrot -u 'shot $W.png'

See the manpage for more special specifies in filenames like this.

(I'm not sure how or where the note option is coming into play here. These special specifiers aren't tied to note option.)

Well dang. Thanks. I couldn't find that in the manpage through a web search so I just ran "$man scrot" and there it is.. Apologies for missing that so egregiously.