From 52751ee989f8725647c8098aa221ac9281b305e0 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 8 Jul 2021 20:26:28 +0800 Subject: [PATCH 1/2] [misc] add ~/Nextcloud/bin to path --- cli/fish/config.fish | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cli/fish/config.fish b/cli/fish/config.fish index faed575..f9d3337 100644 --- a/cli/fish/config.fish +++ b/cli/fish/config.fish @@ -57,7 +57,7 @@ if status is-interactive end # === PATH and file sourcing - append_paths ~/go/bin ~/bin ~/.local/bin ~/.yarn/bin ~/dotfiles/bin ~/dotfiles/devops/bin + append_paths ~/go/bin ~/bin ~/.local/bin ~/.yarn/bin ~/dotfiles/bin ~/dotfiles/devops/bin ~/Nextcloud/bin source_files /usr/share/autojump/autojump.fish /usr/local/share/autojump/autojump.fish \ ~/.jabba/jabba.fish \ ~/.asdf/asdf.fish \ @@ -65,13 +65,5 @@ if status is-interactive # === auto cd into last activated directory test "$PWD" = "$HOME" && cd $last_pwd - - #if test -n "$TMUX" - #function ssh - #tmux rename-window $argv[-1] - #command ssh $argv - #tmux setw automatic-rename - #end - #end end From f58a8f06a2c9750e616018b68594dd4e3d8d4f36 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Thu, 8 Jul 2021 20:39:37 +0800 Subject: [PATCH 2/2] [feature] add x-open script for better compatibility --- bin/bm | 8 +------- bin/x-open | 6 ++++++ cli/fish/config.fish | 4 ---- 3 files changed, 7 insertions(+), 11 deletions(-) create mode 100755 bin/x-open diff --git a/bin/bm b/bin/bm index b5a004a..d0a92ce 100755 --- a/bin/bm +++ b/bin/bm @@ -7,12 +7,6 @@ if set -q BOOKMARK_SEARCHER else set BOOKMARK_SEARCHER fzf --layout reverse end -if string match -iq '*microsoft*' (uname -r) - function xdg-open - powershell.exe -noprofile "start-process '$argv'" - end - alias disown='echo done' # no need to disown on WSL -end function _help echo "Organize your bookmark with markdown" @@ -107,7 +101,7 @@ function _open_urls set LINK_PATTERN '\[(.*?)\]\((.*?)\)' while read LINE if set link (string match -r $LINK_PATTERN $LINE) - echo '' | xdg-open $link[3] &>/dev/null & + echo '' | x-open $link[3] &>/dev/null & disown sleep 0.1 end diff --git a/bin/x-open b/bin/x-open new file mode 100755 index 0000000..1cdf469 --- /dev/null +++ b/bin/x-open @@ -0,0 +1,6 @@ +#!/bin/sh + +case $(uname -r) in + *microsoft*) powershell.exe -noprofile start-process "$@";; + *) xdg-open "$@";; +esac diff --git a/cli/fish/config.fish b/cli/fish/config.fish index f9d3337..3718241 100644 --- a/cli/fish/config.fish +++ b/cli/fish/config.fish @@ -51,10 +51,6 @@ if status is-interactive alias issh='ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' alias iscp='scp -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"' alias dt='date "+%Y%m%d-%H%M%S"' - if string match -iq '*microsoft*' (uname -r) - alias open='powershell.exe -noprofile start-process' - alias xdg-open='open' - end # === PATH and file sourcing append_paths ~/go/bin ~/bin ~/.local/bin ~/.yarn/bin ~/dotfiles/bin ~/dotfiles/devops/bin ~/Nextcloud/bin