Ubuntu Pastebin

Paste from dirk at Wed, 15 Nov 2017 20:00:04 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash


export fileliste="/home/dirk/Shell-Skripte/convert-scripte/yad_und_mp3/fileliste.txt"
export wavliste="/home/dirk/Shell-Skripte/convert-scripte/yad_und_mp3/wavliste.txt"
export mp3liste="/home/dirk/Shell-Skripte/convert-scripte/yad_und_mp3/mp3liste.txt"


rm -rf "$fileliste"
rm -rf "$wavliste"
rm -rf "$mp3liste"


oldifs=$IFS
IFS='
'


function nachWAV() {
	while read line
  	do
		ffmpeg -i "$line" -f wav "${line%.*}.wav"
		#echo "${line%.*}.wav" >> wavliste
  	done < <(cat "$fileliste")
	exit 0
};export -f nachWAV


function nachMP3() {
	while read line
  	do
		ffmpeg -i "$line" -f wav "${line%.*}.wav" && lame -h "${line%.*}.wav" "${line%.*}.mp3"
		#echo "${line%.*}.mp3" >> mp3liste
  	done < "$fileliste"
	exit
};export -f nachMP3


function insertPwFn {
	STUFF="${0//file:\/\//}"
	printf %s\\n "$STUFF" >> "$fileliste"
    	printf %s\\n "$STUFF"
}; export -f insertPwFn


IFS=$oldifs


yad --dnd       --plug=$$ --tabnum=1  --command "bash -c insertPwFn"  --text="\n\nMP3\nhier\nablegen" --text-align=center | yad --text-info --plug=$$ --tabnum=2  --tail &
yad  --paned  --title "MP3 Konverter (c) Dirk Schwalm"   --key=$$  --orient=hor --splitter=100  --width=400 --height=300 --button="nach MP3:bash -c nachMP3" --button="nach WAV:bash -c nachWAV" --button="beenden:1" #--no-buttons


if [ $? == 1 ]
then
	#rm -rf "$fileliste"
	#rm -rf "$wavliste"
	#rm -rf "$mp3liste"
	exit
fi
Download as text