mpv-cam-view/launch

19 lines
475 B
Bash
Executable File

#!/bin/sh
_cam_dir='/usr/local/src/mpv-cam/cams'
_qualities="360\n480\n720\n1080\n2560"
sleep 0.1
_file="$(ls $_cam_dir | dmenu -i -l 10 -p 'Feed:')"
_url="$(cat $_cam_dir/$_file)"
[ -n "$_url" ] || exit
sleep 0.1
_quality="$(echo -e $_qualities | dmenu -i -l 10 -p 'Max quality:')"
[ -n "$_quality" ] || exit
echo "Playing '$_file' at $_quality ($_url)"
bspc rule --add mpv --one-shot state=tiled && mpv --ytdl-raw-options=format='best[height<='"$_quality"']' "$_url"