From 64ef23d5971746da69c92343f1db809b6a6dbc68 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Mon, 9 Nov 2020 16:44:27 +0800 Subject: [PATCH 1/6] [bugfix] fzf failed if already exisits --- fish/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fish/install.sh b/fish/install.sh index fb779a5..cbe6989 100755 --- a/fish/install.sh +++ b/fish/install.sh @@ -11,7 +11,7 @@ case "$PM" in sudo add-apt-repository ppa:fish-shell/release-3 -y sudo apt update sudo apt install fish libnotify-bin xdotool silversearcher-ag dash -y - git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf + [ ! -d ~/.fzf ] && git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf ~/.fzf/install ;; pacman) From 6834c8fbc1b0f2dc3a4a50d5d48803bfc41183c3 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Mon, 9 Nov 2020 16:45:08 +0800 Subject: [PATCH 2/6] [misc] track autostart --- suckless/install.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/suckless/install.sh b/suckless/install.sh index 9f6686e..67f6a98 100755 --- a/suckless/install.sh +++ b/suckless/install.sh @@ -90,13 +90,11 @@ export DMENU_DEFAULT_OPTS='-i -c -fn monospace:13 -nb #222222 -nf #bbbbbb -sb #5 # auto startx [ -z "$DISPLAY" ] && [ -n "$XDG_VTNR" ] && [ "$XDG_VTNR" -eq "1" ] \ - && echo $(date "+%Y%m%d-%H%M%S") '=============== auto start xinit' >> /tmp/xinit.log \ && startx EOT # config dwm -[ -L "$XDG_CONFIG_HOME/dwm/autostart" ] && rm "$XDG_CONFIG_HOME/dwm/autostart" mkdir -p "$XDG_CONFIG_HOME/dwm" -cp "$DIR/config/dwm/autostart" "$XDG_CONFIG_HOME/dwm/autostart" +lnsf "$DIR/config/dwm/autostart" "$XDG_CONFIG_HOME/dwm/autostart" lnsf "$DIR/config/autorandr/postswitch" "$XDG_CONFIG_HOME/autorandr/postswitch" From 0c4e214a68597fdb6abbe4cea5a57c7c7b5d4ff5 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Mon, 9 Nov 2020 16:45:28 +0800 Subject: [PATCH 3/6] [misc] use plainsel for dict.sh on fish shell --- fish/config/config.fish | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fish/config/config.fish b/fish/config/config.fish index 7162021..cd3374a 100644 --- a/fish/config/config.fish +++ b/fish/config/config.fish @@ -53,6 +53,8 @@ if status is-interactive set -gx LS_COLORS 'ow=34;42;40' # ranger highlighting color theme set -gx HIGHLIGHT_OPTIONS --style=solarized-dark + # dict.sh + set -gx D_SELECTOR 'plainsel' # tune git icon for nerdfont set -g __fish_git_prompt_char_upstream_ahead '>' From b8d7f3f7621ba33a4ff9f50546e8f81a4766f066 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Mon, 9 Nov 2020 17:56:32 +0800 Subject: [PATCH 4/6] [misc] fish completion is in official package --- apps/docker.sh | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/apps/docker.sh b/apps/docker.sh index 4b2c5c6..db1210a 100755 --- a/apps/docker.sh +++ b/apps/docker.sh @@ -21,21 +21,12 @@ esac sudo systemctl enable docker sudo systemctl start docker - - # configuration sudo usermod -aG docker "$USER" -# completion -case "$DEFAULT_SHELL" in - $FISH) - curl -sLo "$HOME/.config/fish/completions/docker.fish" --create-dirs \ - 'https://github.com/docker/cli/raw/master/contrib/completion/fish/docker.fish' - ;; -esac - -# set mirror -if in_china && [ -d /etc/docker ]; then +# set mirror for GREAT CHINA +if in_china; then + sudo mkdir -p /etc/docker if [ -f /etc/docker/daemon.json ]; then # backup [ ! -f /etc/docker/daemon.bak.json ] && \ From b12a78eacc5c365969fa0e8de1c627eaa07c5df9 Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Mon, 9 Nov 2020 17:57:06 +0800 Subject: [PATCH 5/6] [feature] set color theme to Old School during installation --- fish/install.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/fish/install.sh b/fish/install.sh index cbe6989..1667ca1 100755 --- a/fish/install.sh +++ b/fish/install.sh @@ -52,3 +52,32 @@ lnsf "$DIR/config/functions/fisher.fish" "$XDG_CONFIG_HOME/fish/functions/fisher # for better keybinding: C-o open file with $EDITOR / C-r search history / C-g open with xdg-open fish -c "fisher add jethrokuan/fzf" +# set color theme: Old School +fish -c ' +set -L +set -U fish_color_normal normal +set -U fish_color_command 00FF00 +set -U fish_color_quote 44FF44 +set -U fish_color_redirection 7BFF7B +set -U fish_color_end FF7B7B +set -U fish_color_error A40000 +set -U fish_color_param 30BE30 +set -U fish_color_comment 30BE30 +set -U fish_color_match --background=brblue +set -U fish_color_selection white --bold --background=brblack +set -U fish_color_search_match bryellow --background=brblack +set -U fish_color_history_current --bold +set -U fish_color_operator 00a6b2 +set -U fish_color_escape 00a6b2 +set -U fish_color_cwd green +set -U fish_color_cwd_root red +set -U fish_color_valid_path --underline +set -U fish_color_autosuggestion 777777 +set -U fish_color_user brgreen +set -U fish_color_host normal +set -U fish_color_cancel -r +set -U fish_pager_color_completion normal +set -U fish_pager_color_description B3A06D yellow +set -U fish_pager_color_prefix white --bold --underline +set -U fish_pager_color_progress brwhite --background=cyan +' From e99ca2d7227558461923298893f1b77005902ebf Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Mon, 9 Nov 2020 18:07:06 +0800 Subject: [PATCH 6/6] [bugfix] abandon DEFAULT_SHELL checking logic --- apps/k8s.sh | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/apps/k8s.sh b/apps/k8s.sh index 7844486..b3c0953 100755 --- a/apps/k8s.sh +++ b/apps/k8s.sh @@ -15,11 +15,9 @@ case "$PM" in esac # completion for fish -case "$DEFAULT_SHELL" in - "$FISH") - [ ! -f "$HOME/.config/fish/completions/docker.fish" ] && \ - curl -Lo "$HOME/.config/fish/completions/docker.fish" --create-dirs \ - 'https://github.com/docker/cli/raw/master/contrib/completion/fish/docker.fish' - fish -c "fisher add evanlucas/fish-kubectl-completions" - ;; -esac +if command -v fish 2>/dev/null ; then + [ ! -f "$HOME/.config/fish/completions/docker.fish" ] && \ + curl -Lo "$HOME/.config/fish/completions/docker.fish" --create-dirs \ + 'https://github.com/docker/cli/raw/master/contrib/completion/fish/docker.fish' + fish -c "fisher add evanlucas/fish-kubectl-completions" +fi