dotfiles-remastered/.local/share/tv/tv.sh

20 lines
413 B
Bash
Raw Normal View History

2020-11-15 17:14:35 +00:00
#!/usr/bin/env sh
# https://wiki.ubuntuusers.de/Internet-TV/Stationen/
set -eu -o pipefail
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")
MAP="$SCRIPTPATH/tv.csv"
cat "$MAP" \
| cut -d ',' -f 1 \
| rofi -dmenu -i -p "TV" \
| head -n 1 \
| xargs -i --no-run-if-empty grep "{}" "$MAP" \
| cut -d ',' -f 2 \
| head -n 1 \
| xargs -i --no-run-if-empty /bin/mpv "{}"
exit 0