feat: mpv function to auto add subtitles opt

This commit is contained in:
ange 2025-07-24 14:17:01 +00:00
parent 5f1b118ff3
commit 304e61574e
Signed by: ange
GPG Key ID: 9E0C4157BB7BEB1D

View File

@ -47,6 +47,19 @@ md2html() {
) done
}
mpv() {
local a opt=()
for a in "$@"; do
if [[ "$a" == *.srt ]] && [[ "$a" != --* ]]; then
opt+=(--sub-file="$a")
else
opt+=("$a")
fi
done
(set -x; command mpv "${opt[@]}")
}
update() {
$TERM --hold -e "$SHELL" -xc "sudo pacman -Syu && echo $'\e[32mDONE'" &
$TERM --hold -e "$SHELL" -xc "git --git-dir='$HOME/.dotfiles/' --work-tree='$HOME' submodule update --remote && echo $'\e[32mDONE'" &