Browse Source

bash: Function tweaks

master
Nick Plekhanov 9 years ago
parent
commit
ab199dade1
  1. 21
      shell/shell_functions

21
shell/shell_functions

@ -129,15 +129,15 @@ camerausedby() {
# animated gifs from any video
# from alex sexton gist.github.com/SlexAxton/4989674
# from Alex Sexton gist.github.com/SlexAxton/4989674
gifify () {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 900x900\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
ffmpeg -i "$1" -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 900x900\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > "$1.gif"
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
ffmpeg -i "$1" -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > "$1.gif"
fi
else
echo "proper usage: gifify <input_movie.mov>. You DO need to include extension."
@ -147,20 +147,11 @@ gifify() {
# turn that video into webm.
# brew reinstall ffmpeg --with-libvpx
webmify () {
ffmpeg -i $1 -vcodec libvpx -acodec libvorbis -isync -copyts -aq 80 -threads 3 -qmax 30 -y $2 $1.webm
ffmpeg -i "$1" -vcodec libvpx -acodec libvorbis -isync -copyts -aq 80 -threads 3 -qmax 30 -y "$2" "$1.webm"
}
# visual studio code. a la `subl`
code () {
if [[ $# = 0 ]]
then
open -a "Visual Studio Code"
else
[[ $1 = /* ]] && F="$1" || F="$PWD/${1#./}"
open -a "Visual Studio Code" --args "$F"
fi
}
code () { VSCODE_CWD="$PWD" open -n -b "com.microsoft.VSCodeInsiders" --args $*; }
# `shellswitch [bash |zsh]`
# Must be in /etc/shells

Loading…
Cancel
Save