[sbopkg-users] Dialog download metre example
Mauro Giachero
mauro.giachero at gmail.com
Thu Aug 27 09:23:36 UTC 2009
On Wed, Aug 26, 2009 at 9:19 PM, David Woodfall <dave at unrealize.co.uk>wrote:
> For Chess and friends.
>
> I was chatting with someone in #slackware the other day about making a
> download metre bar in dialog. Well I took up the challenge and this is
> what I came up with:
>
> http://www.unrealize.co.uk/scripts/bash/wget-dialog-example
>
> I thought it would be pretty neat way to see progress rather than
> having wget output scroll in console.
> Hope you find it useful
>
> Cheers
> David (aka dive)
Interesting hack, thank you.
I too don't like the dotted wget style much, so I prefer to set
--progress=bar:force in WGETFLAGS which results in a nice text progress bar.
If you really like the dialog approach, the following is a much simpler
implementation (which I believe to be roughly equivalent):
wget --progress=bar:force $URL 2>&1 | while read -d "%" X; do sed
's:^.*[^0-9]\([0-9]*\)$:\1:' <<< "$X"; done | dialog --title "foo" --gauge
"bar" 25 40
That being said, I'm dubious about a dialog progress bar because that way
processing a queue would continuously switch between a dialog environment
(download) and a non-dialog environment (build). IIRC the build itself has
been moved out of a dialog environment since it was somewhat problematic.
--
Mauro Giachero
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sbopkg.org/pipermail/sbopkg-users/attachments/20090827/9a8f35e8/attachment.htm>
More information about the sbopkg-users
mailing list