Skip to content

Commit

Permalink
Add optimize_clipboard_image
Browse files Browse the repository at this point in the history
  • Loading branch information
GMadorell committed Jan 24, 2022
1 parent 3983d1f commit 6f3bc2f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,16 @@ function encrypt_zip {
fi
}

function optimize_clipboard_image () {
rm /tmp/test.png
pngpaste /tmp/test.png
pngquant 128 --skip-if-larger --strip --ext=.png --force /tmp/test.png
zopflipng -y /tmp/test.png /tmp/test.png
osascript -e "set the clipboard to (read (POSIX file \"$(perl -e "print glob('/tmp/test.png')")\") as {«class PNGf»})"
echo "Image is optimized :)"
}


function current_directory_size {
du -h $(pwd) | tail -n 1
}
Expand Down Expand Up @@ -963,6 +973,7 @@ function gcbname() {
local commit_message=$(case_converter -f snake -t sentence $branch_name)
gcm "$commit_message"
}
alias gcwip="gcm \"WIP\""

function git_changed_files() { git diff --name-only HEAD~1 ; }
alias gchanged_files=git_changed_files
Expand Down

0 comments on commit 6f3bc2f

Please sign in to comment.