Skip to content

Instantly share code, notes, and snippets.

@lokesh-krishna
Last active October 5, 2021 03:38
Show Gist options
  • Save lokesh-krishna/266199f25ff68b1ea07817223ae662e5 to your computer and use it in GitHub Desktop.
Save lokesh-krishna/266199f25ff68b1ea07817223ae662e5 to your computer and use it in GitHub Desktop.
rang.sh
#!/bin/sh
grim -g "$(slurp -p)" - > /tmp/pixel.png
magick /tmp/pixel.png -colors 1 txt: | tail -n 1 | awk '{print $3}' > /tmp/hex
magick convert /tmp/pixel.png -filter point -resize 96x96 -bordercolor '#303030' -border 5 /tmp/big-pixel.png
notify-send -i /tmp/big-pixel.png " rang" "The hex code is $(cat /tmp/hex)"
cat /tmp/hex | wl-copy -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment