Ask Your Question
1

Help to create bash script-based gui

asked 2012-09-16 16:08:24 -0500

Cielo gravatar image

updated 2014-09-28 10:40:50 -0500

mether gravatar image

Hello everybody!

I am a newie at bash scripts, and I would like to know how to create a panel-based script to create executable files with wget, to mass-download lists of files.

So far, all I have been able to create is this:

!bin/bash

cd ~/ mkdir ~/Downloads/ cd ~/Downloads/ wget -options http://www.someweb.com/some-directory/ exit

I'd like to create something similar to this, but with a graphic enviroment and with a progress bar that is not the tipical [===> ] progress bar.

Thanks.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2012-09-16 18:30:39 -0500

davidva gravatar image

I recommend to use zenity or yad

image description

Yad (yet another dialog) is a fork of Zenity with many improvements, such as custom buttons, additional dialogs, pop-up menu in notification icon and more.

http://code.google.com/p/yad/

How to install yad?

su -c 'yum -y install yad'

Some examples with zenity (you can replace zenity for yad, and work)

http://linuxlibrary.org/zenity-simple-gui-creation-tool/

http://linux.byexamples.com/archives/265/a-complete-zenity-dialog-examples-2/

http://www.linuxjournal.com/content/make-your-scripts-user-friendly-zenity

Dowload bar

example

wget -c http://www.someweb.com/some-directory/miarchive.bin 2>&1 | sed -u 's/.*\ \([0-9]\+%\)\ \+\([0-9.]\+\ [KMB\/s]\+\)$/\1\n# Downloading \2/' | zenity --progress --title="Descargando archivo..."

or

wget -c http://www.someweb.com/some-directory/miarchive.bin 2>&1 | sed -u 's/.*\ \([0-9]\+%\)\ \+\([0-9.]\+\ [KMB\/s]\+\)$/\1\n# Downloading \2/' | yad --progress --title="Descargando archivo..."
edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-09-16 16:08:24 -0500

Seen: 2,495 times

Last updated: Sep 16 '12