dwb: magnet, ftp and mailto content support

master
Pierre Neidhardt 2014-01-04 16:16:02 +01:00
parent dd2f372e36
commit 99f2578503
3 changed files with 39 additions and 28 deletions

View File

@ -140,7 +140,7 @@ scroll-step=0.00
close-last-tab-policy=clear close-last-tab-policy=clear
foreground-color=#ffffff foreground-color=#ffffff
message-delay=2 message-delay=2
scheme-handler=dwb-scheme scheme-handler=
default-font-size=12 default-font-size=12
enable-offline-web-application-cache=true enable-offline-web-application-cache=true
hints-key-lock=250 hints-key-lock=250

View File

@ -4,25 +4,25 @@ extensions.load("adblock_subscriptions", {
//<adblock_subscriptions___CONFIG //<adblock_subscriptions___CONFIG
// Shortcut to subscribe to a filterlist // Shortcut to subscribe to a filterlist
scSubscribe : null, scSubscribe : null,
// Command to subscribe to a filterlist // Command to subscribe to a filterlist
cmdSubscribe : "adblock_subscribe", cmdSubscribe : "adblock_subscribe",
// Shortcut to unsubscribe from a filterlist // Shortcut to unsubscribe from a filterlist
scUnsubscribe : null, scUnsubscribe : null,
// Command to unsubscribe from a filterlist // Command to unsubscribe from a filterlist
cmdUnsubscribe : "adblock_unsubscribe", cmdUnsubscribe : "adblock_unsubscribe",
// Shortcut to update subscriptions and reload filter rules // Shortcut to update subscriptions and reload filter rules
// Note that dwb will also update all subscriptions on startup // Note that dwb will also update all subscriptions on startup
scUpdate : null, scUpdate : null,
// Command to update subscriptions and reload filter rules // Command to update subscriptions and reload filter rules
// Note that dwb will also update all subscriptions on startup // Note that dwb will also update all subscriptions on startup
cmdUpdate : "adblock_update", cmdUpdate : "adblock_update",
// Path to the filterlist directory, will be created if it doesn't exist. // Path to the filterlist directory, will be created if it doesn't exist.
filterListDir : "~/.config/dwb/adblock_lists" filterListDir : "~/.config/dwb/adblock_lists"
//>adblock_subscriptions___CONFIG //>adblock_subscriptions___CONFIG
}); });
@ -36,13 +36,13 @@ forwardBind : "]]",
// Shortcut for navigating to the previous page // Shortcut for navigating to the previous page
backBind : "[[", backBind : "[[",
// Go up one directory, e.g. from http://www.example.com/foo/bar to // Go up one directory, e.g. from http://www.example.com/foo/bar to
// http://www.example.com/foo // http://www.example.com/foo
updirBind : "gu", updirBind : "gu",
// Go to top directory, e.g. from http://www.example.com/foo/bar to // Go to top directory, e.g. from http://www.example.com/foo/bar to
// http://www.example.com // http://www.example.com
topdirBind : "gU", topdirBind : "gU",
// Patterns to match against when searching for "next"-links // Patterns to match against when searching for "next"-links
nextPatterns : "next,more,>,\u2192,\xbb,\u226b,>>", nextPatterns : "next,more,>,\u2192,\xbb,\u226b,>>",
@ -58,14 +58,14 @@ previousPatterns : "prev,previous,back,<,\u2190,\xab,\u226a,<<"
extensions.load("autoquvi", { extensions.load("autoquvi", {
//<autoquvi___CONFIG //<autoquvi___CONFIG
// The quvi command // The quvi command
quvi : "quvi", quvi : "quvi",
// External player command // External player command
player : "mplayer %u", player : "mplayer %u",
// Whether to automatically play videos when quvi find a playable // Whether to automatically play videos when quvi find a playable
// video // video
autoPlay : true, autoPlay : true,
// Whether to choose the quality before quvi starts // Whether to choose the quality before quvi starts
chooseQuality : true, chooseQuality : true,
@ -73,7 +73,7 @@ extensions.load("autoquvi", {
// A shortcut that spawns quvi for the current website // A shortcut that spawns quvi for the current website
shortcut : "", shortcut : "",
// A command that spawns quvi for the current website // A command that spawns quvi for the current website
command : "autoquvi" command : "autoquvi"
//>autoquvi___CONFIG //>autoquvi___CONFIG
@ -93,10 +93,10 @@ extensions.load("downloadhandler", {
// //
// mimeType : a mimetype, optional // mimeType : a mimetype, optional
// //
// { command : "xpdf %f", mimeType : "application/pdf" } // { command : "xpdf %f", mimeType : "application/pdf" }
// { command : "xdvi %f", extension : "dvi" } // { command : "xdvi %f", extension : "dvi" }
] ]
//>downloadhandler___CONFIG //>downloadhandler___CONFIG
}); });
@ -108,23 +108,34 @@ extensions.load("contenthandler", {
// %u will be replaced with the uri of the request, if the handler is a // %u will be replaced with the uri of the request, if the handler is a
// function the first parameter of the function will be the uri and the // function the first parameter of the function will be the uri and the
// function must return the command to execute. // function must return the command to execute.
// Handle requests based on filename extension // Handle requests based on filename extension
extension : { extension : {
// "torrent" : "xterm -e 'aria2 %u'", // "torrent" : "xterm -e 'aria2 %u'",
// "pdf" : "xterm -e 'wget %u --directory-prefix=~/mypdfs'" // "pdf" : "xterm -e 'wget %u --directory-prefix=~/mypdfs'"
}, },
// Handle requests based on URI scheme // Handle requests based on URI scheme
uriScheme : { uriScheme : {
//ftp : function(uri) { ftp : function(uri) {
// if (uri[uri.length-1] == "/") if (uri[uri.length-1] == "/")
// return "xterm -e 'ncftp " + uri + "'"; return "xterm -e 'ncftp " + uri + "'";
// else else
// return "xterm -e 'ncftpget " + uri + "'"; return "xterm -e 'ncftpget " + uri + "'";
//} },
magnet: "transmission-remote -a '%u'" // We need to use 'sh -c' since we need to use a pipe so that xclip can
// read from stdin
mailto : function(uri) {
uri=uri.replace(/mailto:/, "")
uri=uri.replace(/\?/, " ")
return "sh -c ' echo " + uri + " | xclip -i'";
},
// 'trc' is a wrapper script that will launch transmission-daemon if not
// already started.
// magnet: "transmission-remote -a '%u'"
magnet: "trc -a '%u'"
}, },
// Handle requests based on MIME type // Handle requests based on MIME type

View File

@ -12,10 +12,10 @@
"blocklist-url": "http://www.example.com/blocklist", "blocklist-url": "http://www.example.com/blocklist",
"cache-size-mb": 4, "cache-size-mb": 4,
"dht-enabled": true, "dht-enabled": true,
"download-dir": "/home/peter/Downloads", "download-dir": "/home/peter/temp",
"download-queue-enabled": true, "download-queue-enabled": true,
"download-queue-size": 5, "download-queue-size": 5,
"encryption": 1, "encryption": 2,
"idle-seeding-limit": 30, "idle-seeding-limit": 30,
"idle-seeding-limit-enabled": false, "idle-seeding-limit-enabled": false,
"incomplete-dir": "/home/peter/Downloads", "incomplete-dir": "/home/peter/Downloads",