dot

packages and services management
Log | Files | Refs | README

commit c1d57774e9b6912fe677934894b43344d1e72a32
parent 7e279cce04f50fd3e438cb34da309fa095533a29
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 10 Jul 2018 22:27:49 +0200

xdg-open: use directly $EDITOR

Diffstat:
Mbin/xdg-open | 31+++++++++++++++++--------------
Mdot/profile | 4++--
2 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/bin/xdg-open b/bin/xdg-open @@ -30,7 +30,7 @@ case $1 in exec 9pfs "$host" "$dir" ;; (ftp://*) - exec session "$1" ftp "$1" + exec ftp "$1" ;; (gopher://*) exec sacc "$1" @@ -42,22 +42,22 @@ case $1 in exec echo not implemented ;; (news://*) - exec session "$1" links "$1" + exec links "$1" ;; (sftp://*) test -z "$port" && port='22' - exec session "$1" sftp -P $port $host + exec sftp -P $port $host ;; (ssh://*) test "$user" && host=$user@$host test "$port" && port=-p' '$port - exec session "$1" ssh $port "$host" + exec ssh $port "$host" ;; (telnet://*) - exec session "$1" telnet "$port" "$host" + exec telnet "$port" "$host" ;; (radio://*|radios://*) - exec session "$1" ffplay "$(echo "$1" | sed 's,radio,http,')" + exec ffplay "$(echo "$1" | sed 's,radio,http,')" ;; (vnc://*) exec vncviewer -use8 $(echo "$1" | sed 's,vnc://,,') & exit @@ -69,7 +69,7 @@ case $1 in exec echo "TODO: use transmission" ;; (*.img|*.iso) - exec session "$1" qemu-system-x86_64 -m 333M "$1" + exec qemu-system-x86_64 -m 333M "$1" ;; (*.ps) exec gs "$1" & @@ -84,20 +84,20 @@ case $1 in jpg2ff <"$1" | lel & ;; (*.gif) - exec session "$1" ffplay -loop 0 "$1" + exec ffplay -loop 0 "$1" ;; (*.opus|*.mp3|*.flac|*.ogg|*.vorbis|*.wav|*.webm|*.mp4|*.mkv|*.ogv|*.avi|\ */music/*) - exec session "$1" ffplay "$1" + exec ffplay "$1" ;; (*.[0-9]|*.[0-9]p|*.[0-9].gz) - exec session $1 mandoc -a -T utf8 "$1" + exec mandoc -a -T utf8 "$1" ;; (*.o|*.a) - exec session "$1" sh -c "objdump -D '$1' | less" "$1" + exec sh -c "objdump -D '$1' | less" "$1" ;; (*.ics) - exec session "$1" sh -c "ics2txt txt '$1' | less" "$1" + exec sh -c "ics2txt txt '$1' | less" "$1" ;; (*.html) exec links "$1" @@ -152,7 +152,10 @@ case $1 in ;; (*) if test -d "$1" - then exec session "$1" shell "$1" - else exec session "$1" edit "$1" + then cd "$1" + exec $SHEL + else cd "$(dirname "$1")" + exec $EDITOR "$(basename "$1")" + fi esac diff --git a/dot/profile b/dot/profile @@ -2,8 +2,8 @@ export TZ=Europe/Paris export EMAIL=mail@josuah.net -export EDITOR=edit -export VISUAL=edit +export EDITOR=ex +export VISUAL=vi export PAGER=less export ENV=$HOME/.profile