dotfiles/scripts/yt-search.sh

16 lines
229 B
Bash
Raw Normal View History

#!/usr/bin/env sh
search="$(rofi -dmenu)"
2019-12-07 12:22:55 +01:00
if [ -n "$search" ]; then
2019-12-07 12:22:55 +01:00
id="$(youtube-dl --get-id "ytsearch:$search")"
2019-12-07 12:22:55 +01:00
link="https://invidio.us/watch?v=$id"
mpv $MPV_FLAGS "$link" 1>&2
2019-12-07 12:22:55 +01:00
printf "%b\n" "$link"
fi