#!/usr/bin/env bash # Example for dialog fselect (AHG, 2021) dir="/home/pi/video/" cmd=(dialog --title " Move with arrow keys. Select \ with space-bar. " --fselect $dir 14 80) vid=$("${cmd[@]}" 2>&1 >/dev/tty) if [ -z "$vid" ] ; then echo "nothing selected" ; fi if [ -d "$vid" ] ; then echo "directory selected" ; fi if [ -f "$vid" ] ; then vlc $vid ; fi