dot

packages and services management
Log | Files | Refs | README

commit 42bba6bb92a1f63edd2a385836d8d20ca443f6ec
parent 750b87d2e6e52425434abb21da1353b393e8ecff
Author: Josuah Demangeon <mail@josuah.net>
Date:   Mon, 19 Nov 2018 01:32:16 +0100

dot/config/open: make use of execline features

	"importas 1 1" -> "elgetpositionals -P 1"

Diffstat:
Mbin/open | 15++++++++++++---
Dbin/web | 66------------------------------------------------------------------
Mdot/config/open/extension/0 | 2+-
Mdot/config/open/extension/0p | 2+-
Mdot/config/open/extension/1 | 2+-
Mdot/config/open/extension/1p | 2+-
Mdot/config/open/extension/2 | 2+-
Mdot/config/open/extension/2p | 2+-
Mdot/config/open/extension/3 | 2+-
Mdot/config/open/extension/3p | 2+-
Mdot/config/open/extension/4 | 2+-
Mdot/config/open/extension/4p | 2+-
Mdot/config/open/extension/5 | 2+-
Mdot/config/open/extension/5p | 2+-
Mdot/config/open/extension/6 | 2+-
Mdot/config/open/extension/6p | 2+-
Mdot/config/open/extension/7 | 2+-
Mdot/config/open/extension/7p | 2+-
Mdot/config/open/extension/7z | 2+-
Mdot/config/open/extension/8 | 2+-
Mdot/config/open/extension/8p | 2+-
Mdot/config/open/extension/9 | 2+-
Mdot/config/open/extension/9p | 2+-
Mdot/config/open/extension/a | 2+-
Mdot/config/open/extension/avi | 2+-
Mdot/config/open/extension/bz2 | 2+-
Mdot/config/open/extension/deb | 2+-
Mdot/config/open/extension/flac | 2+-
Mdot/config/open/extension/gif | 2+-
Mdot/config/open/extension/gz | 2+-
Mdot/config/open/extension/html | 2+-
Mdot/config/open/extension/ics | 2+-
Mdot/config/open/extension/iso | 2+-
Mdot/config/open/extension/jpeg | 2+-
Mdot/config/open/extension/jpg | 2+-
Mdot/config/open/extension/lz | 2+-
Mdot/config/open/extension/mkv | 2+-
Mdot/config/open/extension/mp3 | 2+-
Mdot/config/open/extension/mp4 | 2+-
Mdot/config/open/extension/o | 2+-
Mdot/config/open/extension/ogg | 2+-
Mdot/config/open/extension/ogv | 2+-
Mdot/config/open/extension/opus | 2+-
Mdot/config/open/extension/pdf | 2+-
Mdot/config/open/extension/png | 2+-
Mdot/config/open/extension/ps | 2+-
Mdot/config/open/extension/rar | 2+-
Mdot/config/open/extension/tar | 2+-
Mdot/config/open/extension/tbz | 2+-
Mdot/config/open/extension/tgz | 2+-
Mdot/config/open/extension/tlz | 2+-
Mdot/config/open/extension/txz | 2+-
Mdot/config/open/extension/vorbis | 2+-
Mdot/config/open/extension/wav | 2+-
Mdot/config/open/extension/webm | 2+-
Mdot/config/open/extension/xz | 2+-
Mdot/config/open/extension/zip | 2+-
Mdot/config/open/protocol/http | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
Mdot/config/open/protocol/https | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
59 files changed, 181 insertions(+), 128 deletions(-)

diff --git a/bin/open b/bin/open @@ -1,11 +1,20 @@ #!/usr/bin/env execlineb -importas 1 1 +elgetpositionals -P 1 backtick -n x { whoami } importas user x backtick -n x { homeof $user } importas home x -backtick -n x { pipeline { echo $1 } sed "s/.*\\.//" } importas protocol x -backtick -n x { pipeline { echo $1 } sed "s,://.*,," } importas extension x +backtick -n x { pipeline { echo $1 } sed "s/.*\\.//" } importas extension x importas -D ${home}/.config/open OPEN OPEN +define regex "([^@:/#]+)://(([^@:/#]*)@)?([^:/#]*)?(:([^/#]*))?(/([^#]*))?(#.*)?" +pipeline { heredoc 0 $1 sed -r "s,${regex},\\1\\n\\2\\n\\4\\n\\6\\n\\8," } +backtick -n x { read } importas protocol x +backtick -n host { read } +backtick -n port { read } +backtick -n file { read } + +redirfd -r 0 /dev/tty +redirfd -w 1 /dev/tty + ifelse { if { test $protocol } test -e ${OPEN}/protocol/${protocol} } { ${OPEN}/protocol/${protocol} $1 } diff --git a/bin/web b/bin/web @@ -1,66 +0,0 @@ -#!/bin/sh -e -# handle http[s]:// links -ifs=' - ' -uri='https?://([^:/#?]*)?(:([^/#?]*))?(/([^#?]*))?([#?].*)?' -read -r host port file << EOF -$(echo $1 | sed -r 's,'$uri',:\1 :\3 :\5,') -EOF -user=${user#:} host=${host#:} port=${port#:} file=${file#:} - -echo "$file" - -case $file in -(*.pdf|*.ps) - type=doc - ;; -(*.jpg|*.png|*.gif) - type=image - ;; -(*.webm|*.mp4|*.mkv|*.ogv|*.avi|*.mp3|*.ogg|*.opus|*.wav|*.flac) - exec ffplay "$1" - ;; -(*.txt) - type=text - ;; -(*) - type='' -esac - -if test "$type" -then name=$(basename "$file" | tr -s '\t #&;*?<>|"''()[]{}\_=+' -) - file=$HOME/tmp/$type/$name - mkdir -p $HOME/tmp/$type - wget -O $file $1 - echo $file - exec xdg-open $file -fi - -case $host in -(*vimeo.com|*youtube.com|*youtu.be|*openload.co) - mkdir -p "$HOME/tmp/video/$host" - cd "$HOME/tmp/video/$host" - file=$PWD/$(youtube-dl --get-filename "$1") - mkdir -p "$(dirname "$file")" - youtube-dl -o "$(echo "$file" | sed 's,%,%%,g')" "$1" - exec xdg-open "$file" - ;; -(*bandcamp.com) - mkdir -p "$HOME/tmp/music/$host" - cd "$HOME/tmp/music/$host" - file=$PWD/$(youtube-dl --get-filename "$1") - youtube-dl "$1" - exec xdg-open "$file" - ;; -(tools.ietf.org) - rfc=$(echo "$path" | sed 's,.*/,,') - rfc=$(echo "$rfc" | sed 's,.txt$,,') - exec rfc "$rfc" - ;; -(*) - if test "$DISPLAY" - then exec chromium "$1" - #exec tabbed -r 3 surf -gips -e '' -a a@ "$1" & - else exec session "$1" links "$1" - fi -esac diff --git a/dot/config/open/extension/0 b/dot/config/open/extension/0 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/0p b/dot/config/open/extension/0p @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/1 b/dot/config/open/extension/1 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/1p b/dot/config/open/extension/1p @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/2 b/dot/config/open/extension/2 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/2p b/dot/config/open/extension/2p @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/3 b/dot/config/open/extension/3 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/3p b/dot/config/open/extension/3p @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/4 b/dot/config/open/extension/4 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/4p b/dot/config/open/extension/4p @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/5 b/dot/config/open/extension/5 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/5p b/dot/config/open/extension/5p @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/6 b/dot/config/open/extension/6 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/6p b/dot/config/open/extension/6p @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/7 b/dot/config/open/extension/7 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/7p b/dot/config/open/extension/7p @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/7z b/dot/config/open/extension/7z @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 7z x $1 +elgetpositionals 7z x $1 diff --git a/dot/config/open/extension/8 b/dot/config/open/extension/8 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/8p b/dot/config/open/extension/8p @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/9 b/dot/config/open/extension/9 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/9p b/dot/config/open/extension/9p @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 mandoc -a -T utf8 $1 +elgetpositionals mandoc -a -T utf8 $1 diff --git a/dot/config/open/extension/a b/dot/config/open/extension/a @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -pipeline { importas 1 1 nm $1 } less +pipeline { elgetpositionals nm $1 } less diff --git a/dot/config/open/extension/avi b/dot/config/open/extension/avi @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/bz2 b/dot/config/open/extension/bz2 @@ -1,3 +1,3 @@ #!/usr/bin/env execlineb -importas 1 1 backtick f { pipeline { echo $1 } sed "s/.bz2$//" } +elgetpositionals backtick f { pipeline { echo $1 } sed "s/.bz2$//" } importas f f if { mv $1 $f } open $f diff --git a/dot/config/open/extension/deb b/dot/config/open/extension/deb @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 ar vx $1 +elgetpositionals ar vx $1 diff --git a/dot/config/open/extension/flac b/dot/config/open/extension/flac @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/gif b/dot/config/open/extension/gif @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 ffplay -loop 0 $1 +elgetpositionals ffplay -loop 0 $1 diff --git a/dot/config/open/extension/gz b/dot/config/open/extension/gz @@ -1,3 +1,3 @@ #!/usr/bin/env execlineb -importas 1 1 backtick f { pipeline { echo $1 } sed "s/.gz$//" } +elgetpositionals backtick f { pipeline { echo $1 } sed "s/.gz$//" } importas f f if { mv $1 $f } open $f diff --git a/dot/config/open/extension/html b/dot/config/open/extension/html @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 links "$1" +elgetpositionals links "$1" diff --git a/dot/config/open/extension/ics b/dot/config/open/extension/ics @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -pipeline { importas 1 1 ics2txt txt $1 } less +pipeline { elgetpositionals ics2txt txt $1 } less diff --git a/dot/config/open/extension/iso b/dot/config/open/extension/iso @@ -1,2 +1,2 @@ #!/bin/sh -e -importas 1 1 qemu-system-x86_64 -m 333M $1 +elgetpositionals qemu-system-x86_64 -m 333M $1 diff --git a/dot/config/open/extension/jpeg b/dot/config/open/extension/jpeg @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -background { pipeline { importas 1 1 redirfd -r 0 $1 jpg2ff } lel } +background { pipeline { elgetpositionals redirfd -r 0 $1 jpg2ff } lel } diff --git a/dot/config/open/extension/jpg b/dot/config/open/extension/jpg @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -background { pipeline { importas 1 1 redirfd -r 0 $1 jpg2ff } lel } +background { pipeline { elgetpositionals redirfd -r 0 $1 jpg2ff } lel } diff --git a/dot/config/open/extension/lz b/dot/config/open/extension/lz @@ -1,3 +1,3 @@ #!/usr/bin/env execlineb -importas 1 1 backtick f { pipeline { echo $1 } sed "s/.lz$//" } +elgetpositionals backtick f { pipeline { echo $1 } sed "s/.lz$//" } importas f f if { mv $1 $f } open $f diff --git a/dot/config/open/extension/mkv b/dot/config/open/extension/mkv @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/mp3 b/dot/config/open/extension/mp3 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/mp4 b/dot/config/open/extension/mp4 @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/o b/dot/config/open/extension/o @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -pipeline { importas 1 1 objdump -D $1 } less +pipeline { elgetpositionals objdump -D $1 } less diff --git a/dot/config/open/extension/ogg b/dot/config/open/extension/ogg @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/ogv b/dot/config/open/extension/ogv @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/opus b/dot/config/open/extension/opus @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/pdf b/dot/config/open/extension/pdf @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 background { mupdf "$1" } +elgetpositionals background { mupdf "$1" } diff --git a/dot/config/open/extension/png b/dot/config/open/extension/png @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -background { pipeline { importas 1 1 redirfd 1 $1 png2ff } lel } +background { pipeline { elgetpositionals redirfd 1 $1 png2ff } lel } diff --git a/dot/config/open/extension/ps b/dot/config/open/extension/ps @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -background { importas 1 1 gs $1 } +background { elgetpositionals gs $1 } diff --git a/dot/config/open/extension/rar b/dot/config/open/extension/rar @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 unrar x $1 +elgetpositionals unrar x $1 diff --git a/dot/config/open/extension/tar b/dot/config/open/extension/tar @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 tar -xf $1 +elgetpositionals tar -xf $1 diff --git a/dot/config/open/extension/tbz b/dot/config/open/extension/tbz @@ -1,3 +1,3 @@ #!/usr/bin/env execlineb -importas 1 1 backtick f { pipeline { echo $1 } sed "s/.tbz$/.tar.bz2/" } +elgetpositionals backtick f { pipeline { echo $1 } sed "s/.tbz$/.tar.bz2/" } importas f f if { mv $1 $f } open $f diff --git a/dot/config/open/extension/tgz b/dot/config/open/extension/tgz @@ -1,3 +1,3 @@ #!/usr/bin/env execlineb -importas 1 1 backtick f { pipeline { echo $1 } sed "s/.tgz$/.tar.gz/" } +elgetpositionals backtick f { pipeline { echo $1 } sed "s/.tgz$/.tar.gz/" } importas f f if { mv $1 $f } open $f diff --git a/dot/config/open/extension/tlz b/dot/config/open/extension/tlz @@ -1,3 +1,3 @@ #!/usr/bin/env execlineb -importas 1 1 backtick f { pipeline { echo $1 } sed "s/.tlz$/.tar.lz/" } +elgetpositionals backtick f { pipeline { echo $1 } sed "s/.tlz$/.tar.lz/" } importas f f if { mv $1 $f } open $f diff --git a/dot/config/open/extension/txz b/dot/config/open/extension/txz @@ -1,3 +1,3 @@ #!/usr/bin/env execlineb -importas 1 1 backtick f { pipeline { echo $1 } sed "s/.txz$/.tar.xz/" } +elgetpositionals backtick f { pipeline { echo $1 } sed "s/.txz$/.tar.xz/" } importas f f if { mv $1 $f } open $f diff --git a/dot/config/open/extension/vorbis b/dot/config/open/extension/vorbis @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/wav b/dot/config/open/extension/wav @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/webm b/dot/config/open/extension/webm @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 play $1 +elgetpositionals play $1 diff --git a/dot/config/open/extension/xz b/dot/config/open/extension/xz @@ -1,3 +1,3 @@ #!/usr/bin/env execlineb -importas 1 1 backtick f { pipeline { echo $1 } sed "s/.xz$//" } +elgetpositionals backtick f { pipeline { echo $1 } sed "s/.xz$//" } importas f f if { mv $1 $f } open $f diff --git a/dot/config/open/extension/zip b/dot/config/open/extension/zip @@ -1,2 +1,2 @@ #!/usr/bin/env execlineb -importas 1 1 unzip $1 +elgetpositionals unzip $1 diff --git a/dot/config/open/protocol/http b/dot/config/open/protocol/http @@ -1,2 +1,57 @@ -#!/bin/sh -ex -exec web "$1" +#!/bin/sh -e + +case $file in +(*.pdf|*.ps) + type=doc + ;; +(*.jpg|*.png|*.gif) + type=image + ;; +(*.webm|*.mp4|*.mkv|*.ogv|*.avi|*.mp3|*.ogg|*.opus|*.wav|*.flac) + exec ffplay "$1" + ;; +(*.txt) + type=text + ;; +(*) + type='' +esac + +if test "$type"; then + name=$(basename "$file" | tr -s '\t #&;*?<>|"''()[]{}\_=+' -) + file=$HOME/tmp/$type/$name + mkdir -p $HOME/tmp/$type + wget -O $file $1 + echo $file + exec xdg-open $file +fi + +case $host in +(*vimeo.com|*youtube.com|*youtu.be|*openload.co) + mkdir -p "$HOME/tmp/video/$host" + cd "$HOME/tmp/video/$host" + file=$PWD/$(youtube-dl --get-filename "$1") + mkdir -p "$(dirname "$file")" + youtube-dl -o "$(echo "$file" | sed 's,%,%%,g')" "$1" + exec xdg-open "$file" + ;; +(*bandcamp.com) + mkdir -p "$HOME/tmp/music/$host" + cd "$HOME/tmp/music/$host" + file=$PWD/$(youtube-dl --get-filename "$1") + youtube-dl "$1" + exec xdg-open "$file" + ;; +(tools.ietf.org) + rfc=$(echo "$path" | sed 's,.*/,,') + rfc=$(echo "$rfc" | sed 's,.txt$,,') + exec rfc "$rfc" + ;; +(*) + if test "$DISPLAY"; then + exec chromium "$1" + #exec tabbed -r 3 surf -gips -e '' -a a@ "$1" & + else + exec "$1" links "$1" + fi +esac diff --git a/dot/config/open/protocol/https b/dot/config/open/protocol/https @@ -1,2 +1,57 @@ -#!/bin/sh -ex -exec web "$1" +#!/bin/sh -e + +case $file in +(*.pdf|*.ps) + type=doc + ;; +(*.jpg|*.png|*.gif) + type=image + ;; +(*.webm|*.mp4|*.mkv|*.ogv|*.avi|*.mp3|*.ogg|*.opus|*.wav|*.flac) + exec ffplay "$1" + ;; +(*.txt) + type=text + ;; +(*) + type='' +esac + +if test "$type"; then + name=$(basename "$file" | tr -s '\t #&;*?<>|"''()[]{}\_=+' -) + file=$HOME/tmp/$type/$name + mkdir -p $HOME/tmp/$type + wget -O $file $1 + echo $file + exec xdg-open $file +fi + +case $host in +(*vimeo.com|*youtube.com|*youtu.be|*openload.co) + mkdir -p "$HOME/tmp/video/$host" + cd "$HOME/tmp/video/$host" + file=$PWD/$(youtube-dl --get-filename "$1") + mkdir -p "$(dirname "$file")" + youtube-dl -o "$(echo "$file" | sed 's,%,%%,g')" "$1" + exec xdg-open "$file" + ;; +(*bandcamp.com) + mkdir -p "$HOME/tmp/music/$host" + cd "$HOME/tmp/music/$host" + file=$PWD/$(youtube-dl --get-filename "$1") + youtube-dl "$1" + exec xdg-open "$file" + ;; +(tools.ietf.org) + rfc=$(echo "$path" | sed 's,.*/,,') + rfc=$(echo "$rfc" | sed 's,.txt$,,') + exec rfc "$rfc" + ;; +(*) + if test "$DISPLAY"; then + exec chromium "$1" + #exec tabbed -r 3 surf -gips -e '' -a a@ "$1" & + else + exec "$1" links "$1" + fi +esac