Admiral: Aria2 Download Manager for Midori (by LeafStorm)
Posted: 6. Oct 2010, 15:38
source: Admiral: Aria2 Download Manager for Midori (by LeafStorm) / Community Contributions / Arch Linux Forums
via: midori:faq > Download Managers [Xfce wiki]
via: midori:faq > Download Managers [Xfce wiki]
midori:faq [Xfce wiki] wrote:Admiral is a shell script that utilizes aria2, Zenity, and libnotify-bin. Admiral allows you to choose the directory to which you wish download a file with a GUI dialog, sends a desktop notification if the download fails and when starting and finishing the download, and logs failures.
LeafStorm wrote:I recently started using Midori on this computer, and wrote my own download manager for it. It's really simple. It depends on aria2, zenity, and notify-send, which aren't hard to get at all. Its advantages over the wget.sh in the Midori FAQ is that (a) it uses aria2, which is apparently faster, (b) it lets you choose the download directory (which I like), and (c) it saves a log and notifies you in case things mess up.Code: Select all
#!/bin/sh # Admiral # Aria2 Download Manager # USAGE: 'admiral $FILE' test -z "$1" && exit 1 URL="$@" FNAME=$(basename "$URL" | cut -d '?' -f 1) echo $FNAME LOGFILE="$HOME/.admiral-log-$$" SAVE=$(zenity --title="Admiral: Save to:" --file-selection --filename="$FNAME" --save) test $? -gt 0 && exit 3 asplode() { notify-send -u critical -t 5000 -i gtk-no "Admiral Asplode!" "Download of $URL failed Check the logfile at $LOGFILE" exit 2 } notify-send -u low -t 1500 -i gtk-save "Admiral" "Began downloading $URL" touch $LOGFILE aria2c -d "$(dirname $SAVE)" -o "$(basename $SAVE)" -l $LOGFILE "$URL" || asplode notify-send -u normal -t 2000 -i gtk-ok "Admiral" "Download of $URL complete Saved to $SAVE" rm $LOGFILE