mirror of
https://github.com/webgefrickel/dotfiles
synced 2024-11-15 12:12:58 +00:00
77 lines
1.8 KiB
Plaintext
77 lines
1.8 KiB
Plaintext
# TERMINAL INTEGRATIONS #
|
|
#########################
|
|
|
|
l () {
|
|
if [ -n $NNNLVL ] && [ "${NNNLVL:-0}" -ge 1 ]; then
|
|
echo "nnn is already running"
|
|
return
|
|
fi
|
|
|
|
export NNN_TMPFILE="${XDG_CONFIG_HOME:-$HOME/.config}/nnn/.lastd"
|
|
|
|
nnn "$@"
|
|
|
|
if [ -f "$NNN_TMPFILE" ]; then
|
|
. "$NNN_TMPFILE"
|
|
rm -f "$NNN_TMPFILE" > /dev/null
|
|
fi
|
|
}
|
|
|
|
take () {
|
|
mkdir -p $1
|
|
cd $1
|
|
}
|
|
|
|
current_branch () {
|
|
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
|
|
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
|
|
echo ${ref#refs/heads/}
|
|
}
|
|
|
|
fancy-ctrl-z () {
|
|
if [[ $#BUFFER -eq 0 ]]; then
|
|
BUFFER="fg"
|
|
zle accept-line
|
|
else
|
|
zle push-input
|
|
zle clear-screen
|
|
fi
|
|
}
|
|
|
|
# CUSTOM FUNCTIONS #
|
|
####################
|
|
|
|
wttr () {
|
|
if [[ -n "$1" ]]
|
|
then
|
|
curl "wttr.in/$1?format=v2"
|
|
else
|
|
curl "wttr.in/Leipzig?format=v2"
|
|
fi
|
|
}
|
|
|
|
webvideo () {
|
|
ffmpeg -i $1 -map_metadata -1 -c:a libfdk_aac -c:v libx264 -crf 24 -preset veryslow -profile:v main -pix_fmt yuv420p -movflags +faststart -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" $1.h264.mp4
|
|
}
|
|
|
|
webvideonoaudio () {
|
|
ffmpeg -i $1 -map_metadata -1 -an -c:v libx264 -crf 24 -preset veryslow -profile:v main -pix_fmt yuv420p -movflags +faststart -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" $1.h264.mp4
|
|
}
|
|
|
|
webvideo1080p () {
|
|
ffmpeg -i $1 -map_metadata -1 -c:a libfdk_aac -c:v libx264 -crf 24 -preset veryslow -profile:v main -pix_fmt yuv420p -movflags +faststart -vf "scale=1920:trunc(ow/a/2)*2" $1.h264.mp4
|
|
}
|
|
|
|
webvideo720p () {
|
|
ffmpeg -i $1 -map_metadata -1 -c:a libfdk_aac -c:v libx264 -crf 24 -preset veryslow -profile:v main -pix_fmt yuv420p -movflags +faststart -vf "scale=1280:trunc(ow/a/2)*2" $1.h264.mp4
|
|
}
|
|
|
|
webvideoposter () {
|
|
ffmpeg -ss 00:00:02 -i $1 -frames:v 1 $1.jpg
|
|
}
|
|
|
|
webgallery () {
|
|
mogrify -format jpg -resize '47.6190476%' -strip -quality 75 *.HEIC
|
|
rm *.HEIC
|
|
}
|