Skip to content

Instantly share code, notes, and snippets.

@carlos22
Last active October 11, 2018 13:11
Show Gist options
  • Save carlos22/a4b12b6dce85a87359f6d4e0a064e730 to your computer and use it in GitHub Desktop.
Save carlos22/a4b12b6dce85a87359f6d4e0a064e730 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
#OUT="$HOME/clip_$(date +%Y-%m-%d_%H-%M-%S).png"
OUT=$(mktemp -t "clip-XXXXXX.png")
xclip -selection clipboard -t image/png -o > $OUT
if [ $? -eq 0 ]; then
echo "clipboard saved to: $OUT"
nautilus $OUT
else
rm $OUT
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment