Skip to content

Conversation

cwarden
Copy link

@cwarden cwarden commented Aug 22, 2025

Add --clipboard flag to copy the full path to the screenshot to the clipboard.

Add --clipboard flag to copy the full path to the screenshot to the
clipboard.
@daltomi
Copy link
Collaborator

daltomi commented Aug 22, 2025

Hi, thanks for contributing.

Please do not modify the man/scrot.1 file, only modify the man/scrot.txt file.

The idea is interesting, but I propose a solution (I think it would be simpler) using options already included in scrot, such as the execution option (-e) plus the use of the output format SPECIAL STRINGS.
Let me explain:

scrot -e 'echo $x | xclip -selection clipboard'

Where $x is the new format with the full path.

There is a $f format, but the documentation is incorrect; it doesn't represent the full path, but rather the full file name.

Pseudocode:

  • Implement a new format for SPECIAL STRINGS, proposal $x
  • Use the format only if no output filename is specified (just like the $f format clarifies.)
  • Concatenate getcwd with the full name of the output file.

Take it as just a proposal on my part, I don't have time right now to implement it.

@N-R-K
Copy link
Collaborator

N-R-K commented Aug 22, 2025

I think --clipboard is a bit confusing because I'd expect it to copy the image not the path. But IMO it's best not to get involved in the clipboard business and instead leave it to tools like xclip (or xsel).

So something like this already works:

scrot -e 'realpath $f | xclip -selection clipboard'

Adding a new format specifier that outputs the fully resolved path, like @daltomi suggested, is also okay and would remove the need to use realpath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants