do nothing if no filename or quality returned

This commit is contained in:
Ray Elliott 2020-10-27 15:06:46 +00:00
parent 2d0bc42f4f
commit 4b7ca4771f
1 changed files with 7 additions and 2 deletions

9
launch
View File

@ -4,9 +4,14 @@ _cam_dir='/usr/local/src/mpv-cam/cams'
_qualities="360\n480\n720\n1080\n2560"
_file="$(ls $_cam_dir | dmenu -p 'Feed:')"
sleep 0.1
_file="$(ls $_cam_dir | dmenu -i -l 10 -p 'Feed:')"
_url="$(cat $_cam_dir/$_file)"
_quality="$(echo -e $_qualities | dmenu -p 'Max quality:')"
[ -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)"