Add description preview
This commit is contained in:
parent
94d3b71cdd
commit
13dc837a52
8
podcast
8
podcast
@ -1,7 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DIR="/home/stek/Dateien/podcasts"
|
cd "$(dirname "$(realpath "$0")")"
|
||||||
cd "$DIR"
|
|
||||||
|
|
||||||
if [ "$1" == "sync" ]; then
|
if [ "$1" == "sync" ]; then
|
||||||
cat "urls"| while read url; do
|
cat "urls"| while read url; do
|
||||||
@ -11,11 +10,10 @@ if [ "$1" == "sync" ]; then
|
|||||||
echo "Updated \"$name\""
|
echo "Updated \"$name\""
|
||||||
done
|
done
|
||||||
elif [ "$1" == "play" ]; then
|
elif [ "$1" == "play" ]; then
|
||||||
rss_file="$(ls -1 *.rss | fzf)"
|
rss_file="$(ls -1 *.rss | sed 's/\(.*\)\.rss/\1/g' | fzf).rss"
|
||||||
nr=$(cat "$rss_file" | xq -r '.rss.channel.item[].title' | nl -v0 -w1 -s ' ' | fzf --with-nth=2.. --no-sort | cut -d " " -f 1)
|
nr=$(cat "$rss_file" | xq -r '.rss.channel.item[].title' | nl -v0 -w1 -s ' ' | fzf --with-nth=2.. --no-sort --preview "cat \"$rss_file\" | xq -r '.rss.channel.item[{1}].description' | html2text --body-width=\$FZF_PREVIEW_COLUMNS" --bind 'ctrl-p:toggle-preview' --preview-window hidden | cut -d " " -f 1)
|
||||||
|
|
||||||
if [ "$nr" != "" ]; then
|
if [ "$nr" != "" ]; then
|
||||||
echo "Play #$nr";
|
|
||||||
mpv "$(cat "$rss_file" | xq -r ".rss.channel.item[$nr].enclosure.\"@url\"")" --no-audio-display
|
mpv "$(cat "$rss_file" | xq -r ".rss.channel.item[$nr].enclosure.\"@url\"")" --no-audio-display
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user