I'm writing my own script to download multiple items (simultaneously, one item per command) using wget
and I need a progress bar. I currently utilize zenity --progress
for my progress bars, but the problem is it spawns multiple progress bars when downloading.
What I want to achieve is something similar to the file transfer dialog in Nautilus:
Can anyone point me to the right direction as to which program(s) or language(s) that will achieve this.
NOTE: I only have basic knowledge of shell scripting, not much else.
Solution using YAD
Overview
Zenity hasn't been updated in quite a while. Luckily there's a fork called YAD with a lot of added features. It hasn't arrived in the official repositories, yet, but you can install it from a webupd8 PPA:
One of the features added to YAD is a multi progress-bar dialog. Here's an excerpt from YAD's manual concerning multiple progress bars:
So a very simple a script with multiple progress bars could look like this:
This is what the result would look like:
We can add descriptions to the bars with
#
:Result:
If we want to implement this in a wget download script we will have to do a few things first:
I found this project rather interesting so I sat down and composed a script that should do all of the above.
yad_wget
Here's what I came up with:
And this is what it looks like:
Make sure to read through all the comments to find out how the script works and if you have any questions please don't hesitate to ask in the comments below.
Edit:
I added support for setting the maximum number of simultaneous downloads. E.g. for
MAXDLS="5"
: