Last active
February 18, 2025 16:39
-
-
Save phagenlocher/5981894250bf48ea44db79895cb94f6b to your computer and use it in GitHub Desktop.
Scrot but saves files in a temporary directory and automatically copies the screenshot to the clipboard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| DIR="/tmp/screenshots" | |
| mkdir -p "$DIR" | |
| TIMESTAMP=$(date +%Y-%m-%dT%H-%M-%S) | |
| FILE=$(mktemp -u -p "$DIR" -t "$TIMESTAMP-XXXXX.png") | |
| scrot -e 'xclip -selection clipboard -t image/png -i $f' "$@" "$FILE" && echo "$FILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment