dotfiles-remastered/.local/share/tv/tv.sh
2020-11-15 18:14:35 +01:00

20 lines
413 B
Bash
Executable File

#!/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