Skip to content

Instantly share code, notes, and snippets.

@nasyxx
Created July 26, 2020 21:24
Show Gist options
  • Select an option

  • Save nasyxx/a213b63849b2ad8ca42cc207ba2e1cc2 to your computer and use it in GitHub Desktop.

Select an option

Save nasyxx/a213b63849b2ad8ca42cc207ba2e1cc2 to your computer and use it in GitHub Desktop.

Revisions

  1. nasyxx created this gist Jul 26, 2020.
    19 changes: 19 additions & 0 deletions sswn.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/bash

    /usr/sbin/screencapture -i /tmp/ss.png

    SSF=$(date +"Screen Shot %Y-%m-%d at %r.png")
    W="$(/Users/Nasy/.macports/bin/identify -format "%w" /tmp/ss.png)"
    H="$(/Users/Nasy/.macports/bin/identify -format "%h" /tmp/ss.png)"
    C="#A7FF83"

    /Users/Nasy/.macports/bin/convert \
    /tmp/ss.png \
    \( -background none -fill $C -font "AppleChancery" -pointsize $((W/30)) -gravity center label:"Nasy" -trim +repage \) \
    \( -clone 1 -background black -shadow 80x25+0+0 \) \
    \( -clone 1 -clone 2 +swap -background none -layers merge +repage \) \
    -delete 1,2 \
    -gravity southeast -compose over -composite \
    \( -clone 0 -background $C -shadow 80x50+0+0 \) \
    -reverse -background none -layers merge +repage \
    "/Users/Nasy/Documents/Screenshots/$SSF"