Admiral: Aria2 Download Manager for Midori (by LeafStorm)

Post Reply
User avatar
zAchAry
Posts: 804
Joined: 11. May 2010, 09:02
Location: Israel

Admiral: Aria2 Download Manager for Midori (by LeafStorm)

Post by zAchAry » 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]
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
Image
Help to make Slackware easier Donate to Salix

User avatar
Duncan_Idaho
Posts: 216
Joined: 19. Sep 2009, 01:43
Location: Sietch Tabr, Planet Arrakis

Re: Admiral: Aria2 Download Manager for Midori (by LeafStorm)

Post by Duncan_Idaho » 6. Oct 2010, 23:29

that looks promising, I'll give it a try :mrgreen:
and thanks for the info

ok, I saved the scrpit as ~/bin/admiral.sh
how do I make midori use it? :?

User avatar
zAchAry
Posts: 804
Joined: 11. May 2010, 09:02
Location: Israel

Re: Admiral: Aria2 Download Manager for Midori (by LeafStorm)

Post by zAchAry » 7. Oct 2010, 07:34

Duncan_Idaho wrote:ok, I saved the scrpit as ~/bin/admiral.sh
how do I make midori use it? :?
Edit > Preferences > Applications > Download Manager: Custom... > ~/bin/admiral.sh

Right-click on the desired link > Download with Download Manager
Image
Help to make Slackware easier Donate to Salix

Post Reply