0

I have this cmds:

(youtube-dl http://www.youtube.com/watch?v=HhoewflkQu0) | zenity --progress --width=400 --height=100 --title="Scaricamento" --text "Scaricamento in corso..." --auto-close --pulsate


But i have a problem: if i click on "abort" or i press the "x" button nothing happens...how can i exit the script and all the processes it has started?

This is the full script:

IFS=$'\n'
down_path=/home/$USER/Scaricati

you_url=`zenity --entry --text "Inserisci URL Youtube" --title "URL"`
file=`youtube-dl --get-filename $you_url`
cd $down_path
(youtube-dl $you_url) | zenity --progress --width=400 --height=100 --title="Scaricamento" --text "Scaricamento in corso..." --auto-close --pulsate
song_name=`zenity --entry --text "Inserisci titolo canzone e autore" --title "Info canzone"`
(ffmpeg -i $down_path/$file $song_name.mp3 -ab 256k 2>&1) | zenity --progress --width=400 --height=100 --title="Conversione" --text "Conversione in corso..." --auto-close --pulsate
rm -f $down_path/$file
unset IFS
notify-send "Conversione terminata" "
Il file:
$song_name.mp3
si trova nella cartella:
/home/$USER/Scaricati
Ti amo piccola mia non dimenticarlo mai
exit 0

1 Answer 1

1

Is it a script or a one-liner?

In a one-liner I would do something like

(youtube-dl http://www.youtube.com/watch?v=HhoewflkQu0 & echo $! > /var/lock/y.pid) | zenity --progress --width=400 --height=100 --title="Scaricamento" --text "Scaricamento in corso..." --auto-close --pulsate; kill `cat /var/lock/y.pid`
1
  • It doesn't work :(
    – Paolo
    Oct 15, 2011 at 8:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .