Browse Source

Fix cliplumber error reporting

master
lara 5 years ago
parent
commit
38e3917e37
  1. 9
      bin/cliplumber
  2. 8
      bin/playvideo

9
bin/cliplumber

@ -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

@ -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
Loading…
Cancel
Save