From 345d0081b98f805f4368746f346b5d6eb0a218d6 Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Mon, 17 Apr 2023 20:05:48 +0300 Subject: [PATCH 1/2] Fix commandline options for the current versions of gifski and gifsicle --- plugins/available/gif.plugin.bash | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/available/gif.plugin.bash b/plugins/available/gif.plugin.bash index a04ff5c7d1..1f47f1f013 100644 --- a/plugins/available/gif.plugin.bash +++ b/plugins/available/gif.plugin.bash @@ -72,9 +72,9 @@ function v2gif() { eval set -- "$args" local use_gifski="" local opt_del_after="" - local maxsize="" - local lossiness="" - local maxwidthski="" + local maxsize=() + local lossiness=() + local maxwidthski=() local giftagopt="" local giftag="" local defaultfps=10 @@ -106,8 +106,8 @@ function v2gif() { shift ;; -w | --width) - maxsize="-vf scale=$2:-1" - maxwidthski="-W $2" + maxsize=(-vf "scale=$2:-1") + maxwidthski=(-W "$2") giftag="${giftag}-w$2" shift 2 ;; @@ -118,7 +118,7 @@ function v2gif() { ;; -l | --lossy) # Use giflossy parameter - lossiness="--lossy=$2" + lossiness=("--lossy=$2") giftag="${giftag}-l$2" shift 2 ;; @@ -164,7 +164,7 @@ function v2gif() { local del_after=$opt_del_after if [[ -n "$make_webm" ]]; then - $ffmpeg -loglevel panic -i "$file" \ + $ffmpeg -loglevel warning -i "$file" \ -c:v libvpx -crf 4 -threads 0 -an -b:v 2M -auto-alt-ref 0 \ -quality best -loop 0 "${file%.*}.webm" || return 2 fi @@ -184,12 +184,12 @@ function v2gif() { if [[ "$use_gifski" = "true" ]]; then # I trust @pornel to do his own resizing optimization choices - $ffmpeg -loglevel panic -i "$file" -r "$fps" -vcodec png v2gif-tmp-%05d.png \ - && $gifski v2gif-tmp-*.png "$maxwidthski" --fps "$(printf "%.0f" "$fps")" -o "$output_file" || return 2 + $ffmpeg -loglevel warning -i "$file" -r "$fps" -vcodec png v2gif-tmp-%05d.png \ + && $gifski "${maxwidthski[@]}" --fps "$(printf "%.0f" "$fps")" -o "$output_file" v2gif-tmp-*.png || return 2 else - $ffmpeg -loglevel panic -i "$file" "$maxsize" -r "$fps" -vcodec png v2gif-tmp-%05d.png \ + $ffmpeg -loglevel warning -i "$file" "${maxsize[@]}" -r "$fps" -vcodec png v2gif-tmp-%05d.png \ && $convert +dither -layers Optimize v2gif-tmp-*.png GIF:- \ - | $gifsicle "$lossiness" --no-warnings --colors 256 --delay="$(echo "100/$fps" | bc)" --loop --optimize=3 --multifile - > "$output_file" || return 2 + | $gifsicle "${lossiness[@]}" --no-warnings --colors 256 --delay="$(echo "100/$fps" | bc)" --loop --optimize=3 --multifile - > "$output_file" || return 2 fi rm v2gif-tmp-*.png @@ -299,7 +299,7 @@ function any2webm() { echo "$(tput setaf 2)Creating '$output_file' ...$(tput sgr 0)" - $ffmpeg -loglevel panic -i "$file" \ + $ffmpeg -loglevel warning -i "$file" \ -c:v libvpx -crf 4 -threads 0 -an -b:v "$bandwidth" -auto-alt-ref 0 \ -quality best "$fps" "$size" -loop 0 -pix_fmt yuva420p "$output_file" || return 2 From d60d806ab4fe5c37a86e4c6849498fdf964e49fa Mon Sep 17 00:00:00 2001 From: Ira Abramov Date: Tue, 5 Nov 2024 11:13:13 +0200 Subject: [PATCH 2/2] new version of oh-my-posh breaks the init commandline, fixing to the new syntax of v24 --- themes/oh-my-posh/oh-my-posh.theme.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/oh-my-posh/oh-my-posh.theme.bash b/themes/oh-my-posh/oh-my-posh.theme.bash index ba3c77f1ef..430c8acb4c 100644 --- a/themes/oh-my-posh/oh-my-posh.theme.bash +++ b/themes/oh-my-posh/oh-my-posh.theme.bash @@ -2,7 +2,7 @@ if _command_exists oh-my-posh; then export POSH_THEME=${POSH_THEME:-https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$(oh-my-posh --version)/themes/jandedobbeleer.omp.json} - eval "$(oh-my-posh --init --shell bash --config "${POSH_THEME}")" + eval "$(oh-my-posh init bash --config "${POSH_THEME}")" else _log_warning "The oh-my-posh binary was not found on your PATH. Falling back to your existing PS1, please see the docs for more info." fi