You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

12 lines
455 B

#!/usr/bin/env bash
pagesource="$(cat -)"
[ -z "$pagesource" ] && pagesource="$(node /home/jonathan/GitRepos/chrome-curl/index.js "$1")"
echo "$pagesource" |\
#hq '.iconPreview' data
hq '.iconPreview' attr style | # This gets the style attribute from the preview element
cut -d '"' -f 2 | cut -d ',' -f 2 | # Gets the base 64 out that we want
base64 -d | # Decodes it
xclip -selection clipboard -target image/svg+xml -i # Puts it on the clipboard