DnDWidget

Miscellaneous tools
Post Reply
Message
Author
stemsee

DnDWidget

#1 Post by stemsee »

This yad desktop pane sends any file/dir dropped here to /tmp/list1.m3u
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
Attachments
capture20847.png
(23 KiB) Downloaded 327 times
DnDWidget.pet
(921 Bytes) Downloaded 197 times
Last edited by stemsee on Sat 21 May 2016, 23:42, edited 1 time in total.

stemsee

#2 Post by stemsee »

What I want is the yad dnd pane to send output to a fifo pipe, the output of the pipe is read by tail -f and sorted first into directories and files. The directory contents get listed by 'ls' command and piped through grep to find media/text files and futher pipes/greps to sort pics,vids,music or text,scripts,pdf,ppt,spreadsheets etc and sent to various lists or pipes for associated apps. Ideally this should happen seamlessly in realtime.

Not there yet but this is better than previous.

Code: Select all

[[ /tmp/list3.m3u ]] && rm /tmp/list3.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/list3.m3u &
yadip=$!
dirorfilefn () {
	[[ /tmp/list2.m3u ]] && rm /tmp/list2.m3u
	[[ /tmp/list1.m3u ]] && rm /tmp/list1.m3u

#	kill $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!"
	mv /tmp/list3.m3u >> /tmp/list2.m3u
	while read line
	do
	line2=`echo $line | cut -f4,5,6,7,8,9,10,11,12,13,14,15,16,17,18 -d '/'`
	if [ -d /"$line2" ]; then
	ls /"$line2"/* | grep -e '.m4v' -e '.swf' -e '.flv' -e '.wmv' -e '.ogg' -e '.ogg' -e '.3gp' -e '.dat' -e '.3gp' -e '.mp3' -e '.mp4' -e '.mpg' -e '.mpeg' -e '.avi' -e '.vob' -e '.au' -e '.txt' -e '.mkv' -e '.wav' -e '.pcm' -e 'flac' -e '.wma' -e '.m4a' -e '.MP3' -e '.MOV' -e '.mov' >> /tmp/list1.m3u
	else
	echo "$line" | grep -e '.m4v' -e '.swf' -e '.flv' -e '.wmv' -e '.ogg' -e '.ogg' -e '.3gp' -e '.dat' -e '.3gp' -e '.mp3' -e '.mp4' -e '.mpg' -e '.mpeg' -e '.avi' -e '.vob' -e '.au' -e '.txt' -e '.mkv' -e '.wav' -e '.pcm' -e 'flac' -e '.wma' -e '.m4a' -e '.MP3' -e '.MOV' -e '.mov' >> /tmp/list1.m3u
	fi
	done < /tmp/list2.m3u
}
dirorfilefn

onefn () {
dirorfilefn
defaultmediaplayer /tmp/list1.m3u
sed -i '1d' /tmp/list1.m3u &
onefn
}

line2=`cat /tmp/list1.m3u`
while true
do
onefn
fun=$!
done

stemsee

#3 Post by stemsee »

trying to use inotifywait, but limited success. The pipes seem to multiple or retain the last string sent. Tail -f worked unreliably too! Maybe it is my system! Too old....

Desktop file router will have to wait for linux to catch up!

stemsee

#4 Post by stemsee »

I have made some progress with this.

Here is what I think is a better way of working and it sorts and opens files according to extension ... not all extensions are catered for at the moment.
I think that adding more defaultapp functions and extension filters might be the way to go, unless someone knows how to incorporate the mime functions ... but actually this should be independent of mime in case mime functions are undefined or otherwise messed up, this script wont depend on them.

But to add is quite simple, just copy an 'other''num''fn' function and modify. Add two new filter lines (one for files one for dirs) in dirorfilefn and call function 'other9fn &' from onefn.

Code: Select all

#!/bin/sh
#dragndrop list creation or desktop file router
# by stemsee 2016
#
# remove previous tmp file lists
	[[ /tmp/list3.m3u ]] && rm /tmp/list3.m3u
	[[ /tmp/list1.m3u ]] && rm /tmp/list1.m3u
	[[ /tmp/list2.m3u ]] && rm /tmp/list2.m3u
#start desktop widget and create initial list
	yad --geometry=60x60 --skip-taskbar --image=/usr/share/pixmaps/dndmplayer.png --undecorated --on-top --tooltip --text=" Drop Media files here; video music TeXT streams" --no-buttons --dnd --cmd echo "$1" > /tmp/list3.m3u &
yadip=$!
yad --image /usr/share/pixmaps/dndmplayer.png --text "End dndwidget" --notification --menu="Close D'n'D pane!kill $yadip!/usr/share/pixmaps/dndmplayer.png|Close app!killall dndwidget!/usr/share/pixmaps/puppy/close.svg|Reset Playlist!rm /tmp/list*.m3u!/usr/share/pixmaps/leafpad.png" --cmd dndwidget &
note=$!

# sort files and dirs to file extension sorted lists
dirorfilefn () {
#start 'trigger' when mouse is over yaf-splash dialogue processing starts
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!"
	##empt=`cat /tmp/list3.m3u`
	cat /tmp/list3.m3u > /tmp/list2.m3u
	while read line
	do
	line2=`echo $line |  sed 's/^.......//'`
	if [[ -d /"$line2" ]]; then
		ls /"$line2"/* | grep -e '.m4v' -e '.swf' -e '.flv' -e '.wmv' -e '.ogg' -e '.ogg' -e '.3gp' -e '.dat' -e '.3gp' -e '.mp3' -e '.mp4' -e '.mpg' -e '.mpeg' -e '.avi' -e '.vob' -e '.au' -e '.mkv' -e '.wav' -e '.pcm' -e 'flac' -e '.wma' -e '.m4a' -e '.MP3' -e '.MOV' -e '.mov' >> /tmp/list1.m3u &
		ls /"$line2"/* | grep -e '.doc' -e '.docx' -e '.odg' -e '.odt' -e '.odf' >> /tmp/listwriter.m3u &
		ls /"$line2"/* | grep -e '.pdf' -e '.PDF' >> /tmp/listpdf.m3u &
		ls /"$line2"/* | grep -e '.jpg' -e '.JPG' -e '.png' -e '.bmp' >> /tmp/listimagev.m3u &
		ls /"$line2"/* | grep -e '.txt' -e '.sh' -e '.lst' >> /tmp/listscript.m3u &
	else
		echo "$line2" | grep -e '.m4v' -e '.swf' -e '.flv' -e '.wmv' -e '.ogg' -e '.ogg' -e '.3gp' -e '.dat' -e '.3gp' -e '.mp3' -e '.mp4' -e '.mpg' -e '.mpeg' -e '.avi' -e '.vob' -e '.au' -e '.mkv' -e '.wav' -e '.pcm' -e 'flac' -e '.wma' -e '.m4a' -e '.MP3' -e '.MOV' -e '.mov' >> /tmp/list1.m3u & #for defaultmediaplayer list
		echo "$line2" | grep -e '.doc' -e '.docx' -e '.odg' -e '.odt' -e '.odf' >> /tmp/listwriter.m3u & #defaultwordprocessor list
		echo "$line2" | grep -e '.pdf' -e '.PDF'  >> /tmp/listpdf.m3u & #defaultpdfviewer list
		echo "$line2" | grep -e '.jpg' -e '.JPG' -e '.png' -e '.bmp' >> /tmp/listimagev.m3u & #defaultimageviewer list
		echo "$line2" | grep -e '.txt' -e '.sh' -e '.lst' >> /tmp/listscript.m3u & #default text/script editor
	fi
	done < /tmp/list2.m3u
cat /tmp/list1.m3u >> /tmp/list4.m3u # create mediaplayer list
}

otherfn () { #pdf
none1=`cat /tmp/listpdf.m3u`
if [[ ! -z "$none1" ]]; then
while read line
do
defaultpdfviewer "$line"
sed -i '1d' /tmp/listpdf.m3u
done < /tmp/listpdf.m3u
fi
}

other2fn () { #word/odt
none2=`cat /tmp/listwriter.m3u`
if [[ ! -z "$none2" ]]; then
while read line
do
defaultwordprocessor "$line"
sed -i '1d' /tmp/listwriter.m3u
done < /tmp/listwriter.m3u
fi
}

other3fn () { #images
none3=`cat /tmp/listimagev.m3u`
if [[ ! -z "$none3" ]]; then
while read line
do
defaultimageviewer "$line"
sed -i '1d' /tmp/listimagev.m3u
done < /tmp/listimagev.m3u
fi
}

other4fn () { #media
none4=`cat /tmp/list4.m3u`
if [[ ! -z "$none4" ]]; then
while read line
do
defaultmediaplayer "$line"
sed -i '1d' /tmp/list4.m3u
done < /tmp/list4.m3u
fi
}

other5fn () { #text .sh files
none5=`cat /tmp/listscript.m3u`
if [[ ! -z "$none5" ]]; then
while read line
do
defaulttexteditor "$line"
sed -i '1d' /tmp/listscript.m3u
done < /tmp/listscript.m3u
fi
}

onefn () { # this is the main loop and restarts the program
dirorfilefn
n=`cat /tmp/list2.m3u | wc -l`
n="1,$n"
none=`cat /tmp/list4.m3u`

if [[ ! -z "$none" ]]; then
	tac /tmp/list1.m3u > /tmp/list
	mv /tmp/list /tmp/list1.m3u
fi

otherfn &
other2fn &
other3fn &
other4fn &
other5fn &
kill $fun
kill $yadip
kill $note
exec $0
}

onefn
Last edited by stemsee on Wed 11 May 2016, 21:40, edited 1 time in total.

stemsee

#5 Post by stemsee »

pet
Attachments
dndwidget.pet
(4.88 KiB) Downloaded 181 times

User avatar
smokey01
Posts: 2813
Joined: Sat 30 Dec 2006, 23:15
Location: South Australia :-(
Contact:

#6 Post by smokey01 »

stemsee, this is a drag and drop script I use for uploading files to my website. It places them in directories according to their extension. It may point you in the right direction.

Code: Select all

#!/bin/sh

USER="yourusername"
PASS="password"

for i in "$@"; do
 case "${i}" in
	*.png|*.PNG|*.jpg|*.jpeg|*.JPG) 
	curl -T "${i}" -u $USER:$PASS ftp://smokey01.com/storage/Smokey01/graphics/ &
	;;
	*.pet)
	curl -T "${i}" -u $USER:$PASS ftp://smokey01.com/storage/Smokey01/pets/ &
	;;
	*.pett|*.sfst)
	curl -T "${i}" -u $USER:$PASS ftp://smokey01.com/storage/Smokey01/test/ &
	;;	
	*.sfs)
	curl -T "${i}" -u $USER:$PASS ftp://smokey01.com/storage/Smokey01/sfs/ &
	;;
	*.txt|*.text|*.pdf|*.doc|*.abw|*.gnumeric|*.ods|*.odt|*.log|*.html|*.help|*.rtf|*.ncd|*.nce)
	curl -T "${i}" -u $USER:$PASS ftp://smokey01.com/storage/Smokey01/documents/ &
	;;
	*.rar|*.tar|*.tar.gz|*.tar.xz|*.tar.bz2|*.tgz|*.txz|*.zip)
	curl -T "${i}" -u $USER:$PASS ftp://smokey01.com/storage/Smokey01/tarballs/ &
	;;
	*.mp3|*.wav|*.wma|*.au|*.ogg) 
	curl -T "${i}" -u $USER:$PASS ftp://smokey01.com/storage/Smokey01/audio/ &
	;;
	*.avi|*.flv|*.mp4|*.mpeg|*.mpeg4|*.wmv|*.rm|*.vob) 
	curl -T "${i}" -u $USER:$PASS ftp://smokey01.com/storage/Smokey01/video/ &
	;; 	
	*) 
	curl -T "${i}" -u $USER:$PASS ftp://smokey01.com/storage/Smokey01/ &
	;; 
 esac
done

stemsee

#7 Post by stemsee »

Thanks smokey01, that is neater filtering.

stemsee

#8 Post by stemsee »

This is working closer to what I imagined at first. Scripts and simple text files are found using

Code: Select all

file $1 | grep ASCII
Icon stays in one place.

filter for browser files tabbed and geany tabbed.
Attachments
dndwidget.pet
(5.04 KiB) Downloaded 157 times

stemsee

#9 Post by stemsee »

I have been working on this, combining it with refdnd.

refdnd provides to dnd panes with corresponding text viewer/editors. Now DTFR (DeskTop File Router) pane. Now it is possible to drag file/s or dir to the pane and the files will be routed to various lists for default apps (media player is set up for mplayer). Currently there are six paths in the router 1) Media files - music and videos 2) pdf 3) odt, doc ,docx, odf 4) images - jpg png bmp etc 5) scripts/txt 6) Browser files -html www .cu.uk etc

There is a tray notification icon with menu. View the media playlist from there. In the Save pane there is a skip/delete track control 'Play/Next Track' only for the media list.

commands can in theory be sent to mplayer which is in slave mode with -input file= option via term like this

Code: Select all

echo "pause" > /tmp/mplayerpipe

The idea is that you can prepare several dis with distinct content; docs, pics, music/videos, web addresses etc that you can simply DragNDrop on the DTFR pane and have that environment ready in a jiffy.

The refs pane are for creating references or what have you, by dragging and dropping from the text panes to the dnd1/2 windows. There is a save/reset/replace functions! It's a convenience thing!

Code: Select all

#!/bin/sh 
# refdnd reference or what-have-you list builder/editor 
#by stemsee, with code from step and MochiMoppel 2016
/tmp/rmyn
lf=$HOME/refs1.txt 
lf2=$HOME/refs2.txt 
lf3=$HOME/refs3.m3u
[[ ! /tmp/mplayerpipe ]] && mkfifo -m 755 /tmp/mplayerpipe


function other1fn () { #pdf
none1=`cat /tmp/listpdf.m3u`
if [[ ! -z "$none1" ]]; then
	defaultpdfviewer "`cat /tmp/listpdf.m3u`"
	#sed -i '1d' /tmp/listpdf.m3u
	rm /tmp/listpdf.m3u
fi
}
export -f other1fn

function other2fn () { #word/odt
none2=`cat /tmp/listwriter.m3u`
if [[ ! -z "$none2" ]]; then
	libreoffice "`cat /tmp/listwriter.m3u`"
	rm -f /tmp/listwriter.m3u
fi
}
export -f other2fn

function other3fn () { #images
[[ /tmp/refpids ]] && . /tmp/refpids
none3=`cat /tmp/listimagev.m3u`
#kill $3pid
if [[ ! -z "$none3" ]]; then
#while read line
#do
	defaultimageviewer `cat /tmp/listimagev.m3u | tr '\n' ' '` #"$line"
	rm -f /tmp/listimagev.m3u
#done < /tmp/listimagev.m3u
fi
}
export -f other3fn

function other4fn () { #media
none4=`cat /tmp/list4.m3u`
if [[ ! -z "$none4" ]]; then
	defaultmediaplayer -slave -input file=/tmp/mplayerpipe -playlist /tmp/list4.m3u
	rm -f /tmp/list4.m3u
fi
}
export -f other4fn

function other5fn () { #text .sh files
none5=`cat /tmp/listscript.m3u`
if [[ ! -z "$none5" ]]; then
	defaulttexteditor `cat /tmp/listscript.m3u | tr '\n' ' '`
	rm /tmp/listscript.m3u
fi
}
export -f other5fn

function other6fn () { #html files
[[ /tmp/refpids ]] && . /tmp/refpids
none6=`cat /tmp/listbrowser.m3u`
#kill $6pid
if [[ ! -z "$none6" ]]; then
	defaultbrowser "`cat /tmp/listbrowser.m3u | tr '\n' ' '`"
	rm /tmp/listbrowser.m3u
fi
}
export -f other6fn

function mplist () {
	/tmp/mplst
	lfp=/tmp/list4.m3u
	cat /tmp/list4.m3u | rev | cut -f1 -d'/' | rev | yad --height=300 --window-icon="/usr/share/pixmaps/leafpad.png" --on-top --title="PlayList" --list --column="Media File Names" &
	pid=$!
	task='kill $mpid'
	echo "#!/bin/sh
	mpid=$pid
	$task
	rm -f /tmp/mplst
	" > /tmp/mplst
	chmod 755 /tmp/mplst
	exit 0
}
export -f mplist

function mediap () {
	lf3=$HOME/refs3.m3u
    STUFFMP="${0//file:\/\//}"
    echo "$STUFFMP" >> $lf3
    geany $lf3
while read line
do
if [[ ! -d "$line" ]]; then
case "$line" in
	*.m4v|*.M4V|*.swf|*.SWF|*.flv|*.FLV|*.WMV|*.wmv|*.ogg|*.OGG|*.3gp|*.3GP|*.dat|*.DAT*.3gp|*.mp3|*.mp4|*.MP4|*.VOB|*.AVI|*.mpg|*.MPG|*.mpeg|*.MPEG|*.avi|*.vob|*.au|*.AU|*.MKV|*.mkv|*.wav|*.WAV|*.pcm|*.PCM|*.flac|*.FLAC|*.wma|*.WMA|*.m4a|*.MP3|*.MOV|*.mov|*.MOV) echo "$line" >> /tmp/list1.m3u;; #for defaultmediaplayer list
	*.xml|*.XML|*.doc|*.DOC|*.docx|*.DOCX|*.odg|*.ODG|*.odt|*.ODT|*.odf|*.ODF) echo "$line" >> /tmp/listwriter.m3u;; #defaultwordprocessor list
	*.pdf|*.PDF) echo "$line" >> /tmp/listpdf.m3u;; #defaultpdfviewer list
	*.jpg|*.JPG|*.png|*.PNG|*.bmp|*.BMP) echo "$line" >> /tmp/listimagev.m3u;; #defaultimageviewer list
	*.html|*.htm|*.com|*.co.uk|*.org|*.ac.uk|www.*|ftp*|http*) echo "$line" >> /tmp/listbrowser.m3u;;
	*) echo "$line" | for i in "$line"; do file "$i" | grep -e 'ASCII' | cut -f1 -d ':' >> /tmp/listscript.m3u; done;; #default text/script editor
esac
sed -i '1d' "$lf3"
fi
if [[ -d "$line" ]]; then
ls "$line"/* | sed "s/^/$line\//g" > /tmp/dirlist
while read it
do
case "$it" in
	*.m4v|*.M4V|*.swf|*.SWF|*.flv|*.FLV|*.WMV|*.wmv|*.ogg|*.OGG|*.3gp|*.3GP|*.dat|*.DAT*.3gp|*.mp3|*.mp4|*.MP4|*.VOB|*.AVI|*.mpg|*.MPG|*.mpeg|*.MPEG|*.avi|*.vob|*.au|*.AU|*.MKV|*.mkv|*.wav|*.WAV|*.pcm|*.PCM|*.flac|*.FLAC|*.wma|*.WMA|*.m4a|*.MP3|*.MOV|*.mov|*.MOV) echo "$it" >> /tmp/list1.m3u;; #for defaultmediaplayer list
	*.xml|*.XML|*.doc|*.DOC|*.docx|*.DOCX|*.odg|*.ODG|*.odt|*.ODT|*.odf|*.ODF) echo "$it" >> /tmp/listwriter.m3u;; #defaultwordprocessor list
	*.pdf|*.PDF) echo "$it" >> /tmp/listpdf.m3u;; #defaultpdfviewer list
	*.jpg|*.JPG|*.png|*.PNG|*.bmp|*.BMP) echo "$it" >> /tmp/listimagev.m3u;; #defaultimageviewer list
	*.html|*.htm|*.com|*.co.uk|*.org|*.ac.uk|www.*|ftp*|http*) echo "$it" >> /tmp/listbrowser.m3u;;
	*) echo "$it" | file "$it" | grep -e 'ASCII' | cut -f1 -d ':' >> /tmp/listscript.m3u;; #default text/script editor
esac
sed -i '1d' /tmp/dirlist
done < /tmp/dirlist
fi
sed -i '1d' "$lf3"
done < ~/refs3.m3u
	sed 's/#####:TM.*//' /tmp/list1.m3u > /tmp/list4.m3u # create mediaplayer list
	killall mplayer
	sleep 1
	mplayer -slave -input file=/tmp/mplayerppe -playlist /tmp/list4.m3u &
	other1fn &
	other2fn &
	other3fn &
	other5fn &
	other6fn &
	geany /tmp/list4.m3u
	#sed -i 's/^/\n/' /tmp/list4.m3u
	exit 0
}
export -f mediap

function control () {
	#. /tmp/refpids
	lfp=/tmp/list4.m3u
	#kill $[1-6]pid
	sed -i '1d' "$lfp"
	bash -c mplist
	killall mplayer
	mplayer -slave -playlist /tmp/list4.m3u &
exit 0
}
export -f control

function newplist () {
	rm -f /tmp/list*.m3u
	touch /tmp/list4.m3u
	rm -f $HOME/refs3.m3u
	touch $HOME/refs3.m3u
	rm -f /tmp/listpdf.m3u
	rm -f /tmp/listwriter.m3u
	rm -f /tmp/listimagev.m3u
	rm -f /tmp/listscript.m3u
	rm -f /tmp/listbrowser.m3u
exit 0
}
export -f newplist

function editor () { 
mv /tmp/xyp /tmp/pyx 
lf=$HOME/refs1.txt 
lf2=$HOME/refs2.txt 
[[ "$lf2" ]] && mv "$lf2" "$lf" 
refdnd & 
sleep 1 
/tmp/pyx 
} 
export -f editor 

function dostuff { 
   lf2=$HOME/refs2.txt 
   STUFF="${0//file:\/\//}" 
   printf %s\\\n "$STUFF" >> "$lf2" 
   printf %s\\\n "$STUFF" 
} 
export -f dostuff 

function save () { 
lf=$HOME/refs1.txt 
lf2=$HOME/refs2.txt
lf3=$HOME/refs3.m3u
fix=$(date | awk '{print $3,$2,$4}' | tr ' ' '_') 
cp "$lf" "$fix"-"$lf"
cp "$lf2" "$fix"-"$lf2"
cp "$lf3" "$fix"-"$lf3"
} 
export -f save 

function blank () { 
mv /tmp/xyp /tmp/pyx 
rm -f "$lf" 
rm -f "$lf2" 
touch "$lf" 
touch "$lf2"
refdnd & 
sleep 1 
/tmp/pyx 
} 
export -f blank

if [ ! -f /tmp/rmyn ]; then
yad --image /usr/share/pixmaps/dndmplayer.png --text "End dndwidget" --notification --menu="Stop Player!killall mplayer!/usr/share/pixmaps/dndmplayer.png|Close app!killall refdnd!/usr/share/pixmaps/puppy/close.svg|Reset Playlist!bash -c newplist!/usr/share/pixmaps/leafpad.png|View playlist!bash -c mplist!/usr/share/pixmaps/leafpad.png|Close Tray!/tmp/rmyn!/usr/share/pixmaps/close.png" --command="refdnd" &
note=$!
task='kill $yadn'
echo "#!/bin/sh
yadn=$note
$task
rm -f /tmp/rmyn
" > /tmp/rmyn
chmod 755 /tmp/rmyn
fi
yad --plug=$$ --tabnum=1 --text="Drag-n-drop items here\nThey will be added to\n/root/refs1.txt list\n---" --dnd --command "bash -c 'printf %s\\\\n \"\${0//file:\/\//}\"'" >> "$lf" & 
yp=`echo $$` 
echo $$ 
task='kill $pid' 
echo "#!/bin/sh 
yp=$yp 
for pid in "`seq $((yp + 10)) 1 $((yp + 30))`" 
do 
$task 
done 
" > /tmp/xyp 
chmod 755 /tmp/xyp
tail -f "$lf" | awk '{fflush();print;fflush()}' | yad --plug=$$ --tabnum=2 --editable --listen --tail --text-info & 
yad --plug=$$ --tabnum=3 --text="Drag-n-drop edits from refs1\nOr refs2 / any source\nThey will create /root/refs2.txt\n---" --dnd --command "bash -c dostuff" > "$lf2" & 
yad --plug=$$ --tabnum=5 --form --field="Replace refs1 with refs2:fbtn" "bash -c editor" --field="'Start New' refs lists:fbtn" "bash -c blank" --field="Save Ref lists by date in /root:fbtn" "bash -c save" --field="Play/Next Track:fbtn" "bash -c control" & 
tail -f "$lf2" | awk '{fflush();print;fflush()}' | yad --plug=$$ --tabnum=4 --editable --listen --tail --text-info &
yad --plug=$$ --tabnum=6 --text="DragNDrop media files here\nThey will be sent to mplayer\n\nCli control in term\necho 'command' > /tmp/mplayerpipe\n\nThis dnd pane is a file-router\n" --listen --dnd --command "bash -c mediap" &
yad --window-icon=/usr/share/pixmaps/leafpad.png --geometry=80x80+80+80 --no-buttons --on-top --notebook --key=$$ --title="D'n'D Ref-lists & PlayMedia" --command "kill $YAD_PID" --tab="DnD1" --tab="refs1" --tab-pos=bottom --tab="DnD2" --tab="refs2" --tab="Save" --tab="Player" &

Post Reply