Files
dotfiles/Scripts/.local/scripts/localstream
Aryadev Chavali 0d7970742f Some work on Scripts
notable changes:
- rename `bt-connect` to `bt_connect`
- rename `music` to `media` and make it generic instead of checking
  Spotify
- make separate script to set background to a preset black image
- make all shebangs "#!/usr/bin/env sh"
2025-04-05 19:40:22 +01:00

36 lines
808 B
Bash
Executable File

#!/usr/bin/env sh
usage() {
printf "Usage: localstream [-f|-p]
\t-f: Lookup video files
\t-p: Lookup playlists\n";
}
if [ $# -eq 0 ]
then
usage && exit 1;
fi
case $1 in
"-f")
filtering="-name '*.mp4' -or -name '*.mkv' -or -name '*.webm' -or -name '*.opus'";
selection="\(.*\)";;
"-p")
filtering="-name 'playlist'";
selection="\(.*\)\/playlist";
ending="/playlist";;
*)
usage && exit 1;;
esac
choice=$(ssh oreo@oldboy "find /media/hdd/content/ -type 'f' $filtering" |\
sed "s/\/media\/hdd\/content\/$selection/\1/g" |\
dmenu -i -l 5 -p "Choose file: ")
if [ $1 = "-f" ]
then
mpv "sftp://oldboy:/media/hdd/content/$choice$ending"
else
mpv --playlist="sftp://oldboy:/media/hdd/content/$choice$ending"
fi