voidrice/.scripts/tools/queueandnotify

19 lines
629 B
Text
Raw Normal View History

2018-12-08 21:01:11 +00:00
#!/bin/sh
# Podboat sucks. This script replaces it.
# It reads the newsboat queue, queuing downloads with taskspooler.
2018-12-09 19:30:58 +00:00
# It also removes the junk from extentions.
2018-12-08 21:01:11 +00:00
queuefile="$HOME/.local/share/newsboat/queue"
while read -r line; do
[ -z "$line" ] && continue
2018-12-09 19:30:58 +00:00
url="$(echo "$line" | awk '{print $1}')"
base="$(basename "$url")"
notify-send -i "$PIX/dl.png" "Queuing $base..."
2018-12-11 21:12:41 +00:00
idnum="$(tsp curl -LO "$url")"
realname="$(echo "$base" | sed "s/?\(source\|dest\).*//;s/%20/ /g")"
tsp -D "$idnum" mv "$base" "$realname"
tsp -D "$idnum" notify-send -i "$PIX/check.png" "$realname done."
2018-12-08 21:01:11 +00:00
done < "$queuefile"
echo > "$queuefile"