t* Removed hard coded terminal type and replaced with XTERM env var. * Added fallback of lynx if sacc is not installed. * Added workaround for mpv not understanding gopher URIs. - plumber - Plumber – a modern approach to plumbing
 (HTM) git clone git://r-36.net/plumber
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit a961e969ebce4cadc4fd176b1ea66acee7cd23c2
 (DIR) parent 71bdea8e7bbb7bf427d877a6603f33384c616da2
 (HTM) Author: ronin <ian@contractcoder.biz>
       Date:   Thu, 31 Dec 2020 12:59:46 +0000
       
       * Removed hard coded terminal type and replaced with XTERM env var. * Added fallback of lynx if sacc is not installed. * Added workaround for mpv not understanding gopher URIs.
       
       Signed-off-by: Christoph Lohmann <20h@r-36.net>
       
       Diffstat:
         README.md                           |       2 ++
         openers/dhlopener                   |       2 +-
         openers/dictopener                  |       2 +-
         openers/fileopener                  |       2 +-
         openers/fingeropener                |       4 ++--
         openers/ftpopener                   |       2 +-
         openers/gopheropener                |       4 +++-
         openers/ldapopener                  |       2 +-
         openers/mediaopener                 |       9 +++++++--
         openers/pageropener                 |       4 ++--
         openers/paperopener                 |       2 +-
         openers/portageopener               |       2 +-
         openers/rfcopener                   |       2 +-
         openers/rpopener                    |       2 +-
         openers/scmopener                   |       2 +-
         openers/sshopener                   |       2 +-
         openers/telnetopener                |       2 +-
         openers/textgopheropener            |       2 +-
         openers/textwebopener               |       2 +-
         openers/wikiopener                  |       2 +-
       
       20 files changed, 31 insertions(+), 22 deletions(-)
       ---
 (DIR) diff --git a/README.md b/README.md
       t@@ -26,6 +26,8 @@ See the LICENSE file for the terms.
                % cp openers/* $HOME/bin
                # Required for dwm integration:
                % cp bin/opener $HOME/bin
       +    % export XTERM=<your_preferred_xterminal>
       +    # Add the above to your .mkshrc or .bashrc to make permanent.
        
        ## Usage
        
 (DIR) diff --git a/openers/dhlopener b/openers/dhlopener
       t@@ -8,5 +8,5 @@ fi
        
        URI="$(printf "%s" "$1" | cut -d':' -f 2-)"
        
       -st -e sh -c "dhl-tracking \"${URI}\" | \$PAGER;"
       +$XTERM -e sh -c "dhl-tracking \"${URI}\" | \$PAGER;"
        
 (DIR) diff --git a/openers/dictopener b/openers/dictopener
       t@@ -20,5 +20,5 @@ dict:*)
        esac
        
        [ -z "$PAGER" ] && PAGER="less"
       -st -e sh -c "dict \"$argument\" | $PAGER"
       +$XTERM -e sh -c "dict \"$argument\" | $PAGER"
        
 (DIR) diff --git a/openers/fileopener b/openers/fileopener
       t@@ -10,7 +10,7 @@ path="$1"
        if [ -d "$path" ];
        then
                [ -z "$SHELL" ] && SHELL="/bin/sh"
       -        st -e /bin/sh -c "cd \"${path}\"; $SHELL" >&2 >/dev/null &
       +        $XTERM /bin/sh -c "cd \"${path}\"; $SHELL" >&2 >/dev/null &
                exit 0
        fi
        
 (DIR) diff --git a/openers/fingeropener b/openers/fingeropener
       t@@ -56,9 +56,9 @@ def main(args):
                        return 1
        
                if req == "":
       -                runcmd("st -e sh -c \"finger -l; read;\"")
       +                runcmd("$XTERM -e sh -c \"finger -l; read;\"")
                else:
       -                runcmd("st -e sh -c \"finger -l '%s'; read;\"", req)
       +                runcmd("$XTERM -e sh -c \"finger -l '%s'; read;\"", req)
        
                return 0
        
 (DIR) diff --git a/openers/ftpopener b/openers/ftpopener
       t@@ -6,5 +6,5 @@ then
                exit 1
        fi
        
       -st -e sh -c "lftp \"$1\""
       +$XTERM -e sh -c "lftp \"$1\""
        
 (DIR) diff --git a/openers/gopheropener b/openers/gopheropener
       t@@ -7,5 +7,7 @@ then
        fi
        
        cd $HOME/Downloads
       -st -e sh -c "sacc \"$1\"" &
       +
       +opener=$([ -x "$(command -v sacc)" ] && echo "sacc" || echo "lynx")
       +$XTERM -e sh -c "$opener \"$1\"" &
        
 (DIR) diff --git a/openers/ldapopener b/openers/ldapopener
       t@@ -6,5 +6,5 @@ then
                exit 1
        fi
        
       -st -e sh -c "shelldap \"$1\""
       +$XTERM -e sh -c "shelldap \"$1\""
        
 (DIR) diff --git a/openers/mediaopener b/openers/mediaopener
       t@@ -6,5 +6,10 @@ then
                exit 1
        fi
        
       -st -e sh -c "mpv \"$1\"" &
       -
       +## mpv doesn't understand gopher ##
       +if [ $(expr "$1" : "^gopher://") -eq 9 ];
       +then
       +    $XTERM -e sh -c "curl -s \"$1\" | mpv -" &
       +else
       +    $XTERM -e sh -c "mpv \"$1\"" &
       +fi
 (DIR) diff --git a/openers/pageropener b/openers/pageropener
       t@@ -24,11 +24,11 @@ then
        else
                if [ -d "${f}" ];
                then
       -                st -e sh -c "cd \"${f}\"; $SHELL"
       +                $XTERM -e sh -c "cd \"${f}\"; $SHELL"
                else
                        if [ -e "${f}" ];
                        then
       -                        st -e sh -c "$PAGER \"${f}\""
       +                        $XTERM -e sh -c "$PAGER \"${f}\""
                        fi
                fi
        fi
 (DIR) diff --git a/openers/paperopener b/openers/paperopener
       t@@ -10,5 +10,5 @@ fi
        
        URI="$(printf "%s" "$1" | cut -d':' -f 2-)"
        
       -st -e sh -c "cd \"${URI}\" && ${FILEMANAGER}"
       +$XTERM -e sh -c "cd \"${URI}\" && ${FILEMANAGER}"
        
 (DIR) diff --git a/openers/portageopener b/openers/portageopener
       t@@ -8,5 +8,5 @@ fi
        
        URI="$(printf "%s" "$1" | cut -d':' -f 2-)"
        
       -st -e sh -c "esearch \"${URI}\" | \$PAGER;"
       +$XTERM -e sh -c "esearch \"${URI}\" | \$PAGER;"
        
 (DIR) diff --git a/openers/rfcopener b/openers/rfcopener
       t@@ -8,5 +8,5 @@ fi
        
        URI="$(printf "%s" "$1" | cut -d':' -f 2-)"
        
       -st -e sh -c "rfc \"rfc${URI}\""
       +$XTERM -e sh -c "rfc \"rfc${URI}\""
        
 (DIR) diff --git a/openers/rpopener b/openers/rpopener
       t@@ -30,6 +30,6 @@ if [ "${rpcmd}" = "rpopen" ];
        then
                rpopen -c "${account}" -m "${mailbox}" "${ids}"
        else
       -        st -e sh -c "${rpcmd} -c \"${account}\" -m \"${mailbox}\" \"${ids}\""
       +        $XTERM -e sh -c "${rpcmd} -c \"${account}\" -m \"${mailbox}\" \"${ids}\""
        fi
        
 (DIR) diff --git a/openers/scmopener b/openers/scmopener
       t@@ -12,7 +12,7 @@ path="$SCM/$(printf "%s\n" "$1" | cut -d':' -f 2-)"
        if [ -d "$path" ];
        then
                [ -z "$SHELL" ] && SHELL="/bin/sh"
       -        st -e /bin/sh -c "cd \"${path}\"; $SHELL" >&2 >/dev/null &
       +        $XTERM /bin/sh -c "cd \"${path}\"; $SHELL" >&2 >/dev/null &
                exit 0
        fi
        
 (DIR) diff --git a/openers/sshopener b/openers/sshopener
       t@@ -25,7 +25,7 @@ port="$(printf "%s\n" "$uri" \
                | cut -d '/' -f 1)"
        [ -z "$port" ] && port="22"
        
       -st -e sh -c \
       +$XTERM -e sh -c \
                "printf \"URI: %s\n\" "${uri}"; \
                 ssh -p \"${port}\" \"${host}\"; \
                 read;" \
 (DIR) diff --git a/openers/telnetopener b/openers/telnetopener
       t@@ -9,5 +9,5 @@ then
        fi
        
        cd $HOME/Downloads
       -st -e sh -c "telnetopenerchild \"$1\""
       +$XTERM -e sh -c "telnetopenerchild \"$1\""
        
 (DIR) diff --git a/openers/textgopheropener b/openers/textgopheropener
       t@@ -7,5 +7,5 @@ then
        fi
        
        cd $HOME/Downloads
       -st -e sh -c "lynx \"$1\""
       +$XTERM -e sh -c "lynx \"$1\""
        
 (DIR) diff --git a/openers/textwebopener b/openers/textwebopener
       t@@ -7,5 +7,5 @@ then
        fi
        
        cd $HOME/Downloads
       -st -e sh -c "w3m \"$1\""
       +$XTERM -e sh -c "w3m \"$1\""
        
 (DIR) diff --git a/openers/wikiopener b/openers/wikiopener
       t@@ -8,5 +8,5 @@ fi
        
        URI="$(printf "%s" "$1" | cut -d':' -f 2-)"
        
       -st -e sh -c "wiki -e \"${URI}\";"
       +$XTERM -e sh -c "wiki -e \"${URI}\";"