From 5172ecf855078938b00e9ac7f8dee2c2676f6e53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Tue, 13 Jan 2015 23:35:48 +0100 Subject: Commit initial --- execurl | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100755 execurl (limited to 'execurl') diff --git a/execurl b/execurl new file mode 100755 index 0000000..655d208 --- /dev/null +++ b/execurl @@ -0,0 +1,44 @@ +#!/usr/bin/env bash +# The MIT License (MIT) +# +# Copyright (c) 2011-2015 Ismaƫl Bouya http://www.normalesup.org/~bouya/ +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. + + +# To be used together with remove_attachements script in procmail and urlview to +# visualize and keep some attachements once they are removed from the email +# Example urlview updated configuration: +# REGEXP ((((http|https|ftp|gopher)|mailto):(//)?[^ <>"\t]*|(www|ftp)[0-9]?\.[-a-z0-9.]+)[^ .,;\t\n\r<">\):]?[^, <>"\t]*[^ .,;\t\n\r<">\):]|(file|keepdir)://([^\t\n\r\\ ]+(\\ |\\)?)+) +# COMMAND execurl + +export chemin=x"$1" +if [ "${chemin:0:8}" = "xfile://" ]; then + fichier="${1:7}" + fichierlu="${fichier//\\ / }" + if [ ! -f "$fichierlu" ]; then + exec run-mailcap "${fichierlu//.attachements/Mail/.attachements}" + else + exec run-mailcap "$fichierlu" + fi +elif [ "${chemin:0:11}" = "xkeepdir://" ]; then + mv "${1:10}" "$HOME/Mail/.attachements/" +else + exec w3m "$1" +fi -- cgit v1.2.3