and opens in defaultmediaplayer. On my system it is mplayer, which plays video music and .txt plain text files.
The logic needs a lot of improvement. Initially I just wanted to quickly add items to an excluded list for an rsync command. This does that without typing. I also use the list for creating bibliographies and remaster exclude list.
I hope to make this a desktop file router, which pipes files to appropriate app either by parsing extension or perhaps examining mimetypes.
I think this is going to be too difficult for me though. You can try!
Code: Select all
#!/bin/sh
#dragndrop list creator
# by stemsee
# 2016
[[ /tmp/list1.m3u ]] && rm /tmp/list1.m3u
yad --geometry=60x60 --skip-taskbar --image=/usr/share/pixmaps/gnome-mplayer.png --undecorated --on-top --tooltip --text=" Drop Media files here; video music TeXT streams" --no-buttons --dnd --cmd echo $1 >> /tmp/list1.m3u &
yadip=$!
yaf-splash -placement top-left -text "Add media files by dropping them (multiples ok) on the top-left media pane.Hover mouse here when ready!"
onefn () {
line1=`cat /tmp/list1.m3u`
if [ ! -z "$line1" ]; then
defaultmediaplayer /tmp/list1.m3u
sed -i '1d' /tmp/list1.m3u &
else
yaf-splash -text "Nothing to do! Add media ..." -timeout 4
kill $yadip
sleep 4
exec $0
exit 0
fi
onefn
}
line2=`cat /tmp/list1.m3u`
while [ ! -z "$line2" ]; do
line2=`cat /tmp/list1.m3u`
onefn
done