From d20a482068e350b5d75f9d74cdf18db40d241066 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sat, 3 Aug 2013 16:07:08 +0200 Subject: [PATCH] dwb: scheme handler (mailto and ftp) --- .config/dwb/settings | 2 +- .scripts/dwb-scheme | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100755 .scripts/dwb-scheme diff --git a/.config/dwb/settings b/.config/dwb/settings index bd949b47..3bc36f9b 100644 --- a/.config/dwb/settings +++ b/.config/dwb/settings @@ -140,7 +140,7 @@ scroll-step=0.00 close-last-tab-policy=clear foreground-color=#ffffff message-delay=2 -scheme-handler= +scheme-handler=dwb-scheme default-font-size=12 enable-offline-web-application-cache=true hints-key-lock=250 diff --git a/.scripts/dwb-scheme b/.scripts/dwb-scheme new file mode 100755 index 00000000..a9f8cb7c --- /dev/null +++ b/.scripts/dwb-scheme @@ -0,0 +1,14 @@ +#!/bin/sh + +## TODO: 'urxvt -e' does not seem to work with ftp clients. +TERMCMD=xterm + +[ -z "$(command -v xclip)" ] && exit +[ -z "$(command -v xdg-open)" ] && exit +[ -z "$(command -v $TERMCMD)" ] && exit + +case ${DWB_SCHEME} in + mailto) echo "${DWB_URI}" | sed -e 's/mailto://' -e 's/?/ /' | xclip -i ;; + ftp) $TERMCMD -e "lftp ${DWB_URI}";; + *) xdg-open "${DWB_URI}" +esac