diff --git a/download-youtube b/download-youtube index 4809570..0a1e784 100755 --- a/download-youtube +++ b/download-youtube @@ -1,4 +1,14 @@ #!/bin/sh cd ~/Downloads -YTDL_WD=$(zenity --file-selection --directory --filename=.) -xfce4-terminal --default-working-directory $YTDL_WD --execute youtube-dl $@ +YTDL_WD="." + +if [ $(command -v zenity) ]; then + YTDL_WD=$(zenity --file-selection --directory --filename=.) +fi + +if [ $(command -v xfce4-terminal) ]; then + xfce4-terminal --default-working-directory "$YTDL_WD" --execute youtube-dl $@ +else + cd "$YTDL_WD" + youtube-dl $@ +fi