Last active
December 18, 2022 12:39
-
-
Save activeguild/d649989c1860c076f2d2052a7875f8d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function watch_desktop() { | |
fswatch -e ".*" -i ".mov" ~/Desktop | while read filePath; do | |
if [ -f "${filePath}" ]; then | |
if [ -f "${filePath/.mov/.gif}" ]; then | |
echo 'exists.' | |
else | |
echo 'not exists.' | |
ffmpeg -i "$filePath" -r 30 -vf scale=680:-1 "${filePath/mov/gif}" | |
osascript -e "display notification \"${filePath/mov/gif}\" with title \"Conversion to gif completed.\" sound name \"default\"" | |
fi | |
fi | |
done | |
} | |
watch_desktop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment