refactor
This commit is contained in:
parent
828bb9cf84
commit
4488e05a86
12 changed files with 57 additions and 18 deletions
|
@ -1,3 +0,0 @@
|
||||||
alias ls="exa"
|
|
||||||
alias l="exa -l"
|
|
||||||
alias la="exa -la"
|
|
3
zsh/eza.zsh
Normal file
3
zsh/eza.zsh
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
alias ls="eza"
|
||||||
|
alias l="eza -l"
|
||||||
|
alias la="eza -la"
|
2
zsh/ffmpeg.zsh
Normal file
2
zsh/ffmpeg.zsh
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
# print duration of video file
|
||||||
|
alias ffprobe_duration="ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1"
|
8
zsh/fn.zsh
Normal file
8
zsh/fn.zsh
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# rename <OLD> <NEW>
|
||||||
|
# rename files with replace pattern
|
||||||
|
function rename() {
|
||||||
|
rnr -f --no-dump "$1" "$2" ./*
|
||||||
|
}
|
||||||
|
|
||||||
|
alias cat="bat -p"
|
||||||
|
alias gfold="gfold -d classic"
|
|
@ -1,8 +1,10 @@
|
||||||
|
# find mac files
|
||||||
function find_mac_files() {
|
function find_mac_files() {
|
||||||
find . -name '.DS_Store';
|
find . -name '.DS_Store';
|
||||||
find . -name '._*';
|
find . -name '._*';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# delete mac files
|
||||||
function clean_mac_files() {
|
function clean_mac_files() {
|
||||||
find . -name '.DS_Store' -type f -delete;
|
find . -name '.DS_Store' -type f -delete;
|
||||||
find . -name '._*' -type f -delete
|
find . -name '._*' -type f -delete
|
||||||
|
|
|
@ -1,7 +1,18 @@
|
||||||
|
# convert <OLD_EXT> <NEW_EXT>
|
||||||
|
# convert all files with old_ext to new_ext using ffmpeg
|
||||||
function convert() {
|
function convert() {
|
||||||
for i in *.$1; do ffmpeg -i "$i" "${i%.*}.$2"; done
|
for i in *.$1; do ffmpeg -i "$i" "${i%.*}.$2"; done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# remux all mkvs in current dir to mp4
|
||||||
function mkvToMp4() {
|
function mkvToMp4() {
|
||||||
for i in *.mkv; do ffmpeg -i "$i" -map 0 -c copy "${i%.*}.mp4"; done
|
for i in *.mkv; do ffmpeg -i "$i" -map 0 -c copy "${i%.*}.mp4"; done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# gif2avif <GIF>
|
||||||
|
# convert gif to avif image
|
||||||
|
function gif2avif() {
|
||||||
|
ffmpeg -i "$1" -pix_fmt yuv444p10 -strict -1 "${1%.*}.y4m";
|
||||||
|
avifenc "${1%.*}.y4m" "${1%.*}.avif";
|
||||||
|
rm -v "${1%.*}.y4m";
|
||||||
|
}
|
|
@ -1,3 +1,4 @@
|
||||||
|
# create directory and move into it
|
||||||
function mkcd() {
|
function mkcd() {
|
||||||
mkdir $1 && cd $1
|
mkdir $1 && cd $1
|
||||||
}
|
}
|
||||||
|
|
7
zsh/std.zsh
Normal file
7
zsh/std.zsh
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# usage: skip N
|
||||||
|
# skip n elements from input
|
||||||
|
function skip() {
|
||||||
|
local n=$1
|
||||||
|
shift
|
||||||
|
tail -n +"$((n+1))" "$@"
|
||||||
|
}
|
|
@ -1,6 +0,0 @@
|
||||||
function mkVideoProj() {
|
|
||||||
mkdir $1 && cd $1;
|
|
||||||
mkdir -p Media;
|
|
||||||
mkdir -p Renders;
|
|
||||||
mkdir -p Thumbnails;
|
|
||||||
}
|
|
6
zsh/web.zsh
Normal file
6
zsh/web.zsh
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
|
||||||
|
# webhook_post <URL>
|
||||||
|
# send curl post request
|
||||||
|
function webhook_post() {
|
||||||
|
curl -X POST "$1"
|
||||||
|
}
|
|
@ -1,10 +1,18 @@
|
||||||
alias downloadVid="yt-dlp --downloader aria2c -o \"%(title)s.%(ext)s\" -f \"bestvideo[height<=1080]+bestaudio\" --write-thumbnail"
|
USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36"
|
||||||
alias downloadVid1440="yt-dlp --downloader aria2c -o \"%(title)s.%(ext)s\" -f \"bestvideo[height<=1440]+bestaudio\" --write-thumbnail"
|
|
||||||
alias downloadVid4K="yt-dlp --downloader aria2c -o \"%(title)s.%(ext)s\" -f \"bestvideo[height<=2160]+bestaudio\" --write-thumbnail"
|
alias yt-dlp="yt-dlp \
|
||||||
alias downloadAudio="yt-dlp --downloader aria2c -o \"%(playlist_index)s %(title)s.%(ext)s\" -x"
|
--downloader aria2c \
|
||||||
alias downloadMusic="yt-dlp --downloader aria2c -x --add-metadata -o \"%(playlist_title)s/%(playlist_index)s %(title)s.%(ext)s\""
|
--cookies-from-browser brave \
|
||||||
alias dlBeat="yt-dlp --downloader aria2c --no-playlist --audio-format m4a -x"
|
--user-agent \"$USER_AGENT\""
|
||||||
alias downloadYT="yt-dlp --downloader aria2c --write-thumbnail -o \"%(title)s.%(ext)s\" --embed-thumbnail --embed-chapters --embed-info-json --convert-thumbnails jpg"
|
|
||||||
|
alias downloadAudio="yt-dlp -o \"%(playlist_index)s %(title)s.%(ext)s\" -x"
|
||||||
|
alias downloadMusic="yt-dlp -x --add-metadata -o \"%(playlist_title)s/%(playlist_index)s %(title)s.%(ext)s\""
|
||||||
|
alias dlBeat="yt-dlp --no-playlist --audio-format m4a -x"
|
||||||
|
alias downloadYT="yt-dlp --write-thumbnail \
|
||||||
|
-o \"%(title)s.%(ext)s\" --embed-thumbnail \
|
||||||
|
--embed-chapters --embed-info-json \
|
||||||
|
--convert-thumbnails jpg"
|
||||||
|
|
||||||
function downloadList() {
|
function downloadList() {
|
||||||
cat $1 |xargs -I _ yt-dlp --downloader aria2c _
|
cat $1 |xargs -I _ yt-dlp --downloader aria2c _
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue