Fix cliplumber error reporting

This commit is contained in:
lara 2020-11-20 19:12:05 +01:00
parent c189ae8ae3
commit 38e3917e37
2 changed files with 12 additions and 5 deletions

View file

@ -14,9 +14,9 @@ check_exists() {
done
}
if ! which wl-paste > /dev/null && [ ! -z "$WAYLAND_DISPLAY" ]; then
if ! which wl-paste > /dev/null 2>&1 && [ ! -z "$WAYLAND_DISPLAY" ]; then
die "Wayland detected and wl-paste not found"
elif ! which xsel > /dev/null && [ -z "$WAYLAND_DISPLAY" ]; then
elif ! which xsel > /dev/null 2>&1 && [ -z "$WAYLAND_DISPLAY" ]; then
die "xsel not found"
fi
@ -61,8 +61,7 @@ case "$choice" in
path="$HOME/mus/$(printf "%s" "$choice" | cut -d " " -f 2-)"
[ -d "$path" ] || mkdir -p "$path"
cd "$path" || exit
youtube-dl -x --audio-format mp3 --no-playlist -o "%(title)s.%(ext)s" "$urls" 2>&1 | grep 'ERROR:' | xargs -n1 -d "\n" notify-send
#notify-send "Error while downloading: $clip"
youtube-dl -x --audio-format mp3 --no-playlist -o "%(title)s.%(ext)s" "$urls" 2>&1 | grep 'ERROR:' | tee /dev/fd/2 | xargs -n1 -d "\n" notify-send
;;
"crawl")
path="$HOME/books/"
@ -80,7 +79,7 @@ case "$choice" in
dragon -x "$clip"
;;
"play")
mpv --ytdl-format='bestvideo[height<=?720]+bestaudio/best' "$clip" 2>&1 | grep 'ERROR:' | xargs -n1 -d "\n" notify-send
playvideo "$clip"
;;
"audio-search")

8
bin/playvideo Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
if [ "$1" = "-h" ] || [ "$#" -ne "1" ]; then
>&2 echo "Usage: $0 <input.mp4> <output.gif>"
exit 1
fi
mpv --ytdl-format='bestvideo[height<=?720]+bestaudio/best' "$1" 2>&1 | grep 'ERROR:' | tee /dev/fd/2 | xargs -n1 -d "\n" notify-send