[feature] dash as default shell to improve perf

This commit is contained in:
Klesh Wong 2020-10-31 14:27:44 +08:00
parent c1167f0bcf
commit 242a2ec113
4 changed files with 27 additions and 11 deletions

View File

@ -107,7 +107,7 @@ end
# auto startx # auto startx
if test -z "$STARTED" -a -z "$DISPLAY" -a -n "$XDG_VTNR" -a "$XDG_VTNR" -eq "1" if test -z "$STARTED" -a -z "$DISPLAY" -a -n "$XDG_VTNR" -a "$XDG_VTNR" -eq "1"
set -gx STARTED true set -gx STARTED true
startx exec startx
end end
if status is-interactive if status is-interactive

View File

@ -10,7 +10,7 @@ case "$PM" in
! which pip3 && $ROOT/python/install.sh ! which pip3 && $ROOT/python/install.sh
sudo add-apt-repository ppa:fish-shell/release-3 -y sudo add-apt-repository ppa:fish-shell/release-3 -y
sudo apt update sudo apt update
sudo apt install fish libnotify-bin xdotool silversearcher-ag -y sudo apt install fish libnotify-bin xdotool silversearcher-ag dash -y
if apt show fzf &>/dev/null; then if apt show fzf &>/dev/null; then
sudo apt install fzf sudo apt install fzf
elif ! which fzf &>/dev/null; then elif ! which fzf &>/dev/null; then
@ -20,14 +20,30 @@ case "$PM" in
;; ;;
pacman) pacman)
! which pip && $ROOT/python/install.sh ! which pip && $ROOT/python/install.sh
sudo pacman -S --needed --needed fish xdotool fzf the_silver_searcher sudo pacman -S --needed --needed fish xdotool fzf the_silver_searcher dash
# prevent bash upgradation relink /bin/sh
sudo mkdir -p /etc/pacman.d/hooks
cat <<-EOT | sed 's/^ *//' | sudo tee /etc/pacman.d/sh-is-dash.hook
[Trigger]
Type = Package
Operation = Install
Operation = Upgrade
Target = bash
[Action]
Description = Re-pointing /bin/sh symlink to dash...
When = PostTransaction
Exec = /usr/bin/ln -sfT dash /usr/bin/sh
Depends = dash
EOT
;; ;;
esac esac
# set fish as default shell # use dash as default shell because it much faster and will be used vim-fugitive,
if ! fish-is-default-shell; then # which leads to a much faster responsive speed
chsh -s $FISH_SHELL sudo /usr/bin/ln -sfT dash /usr/bin/sh
fi chsh -s /bin/sh
# symlink config # symlink config
[ -L $XDG_CONFIG_HOME/fish ] && rm -rf $XDG_CONFIG_HOME/fish [ -L $XDG_CONFIG_HOME/fish ] && rm -rf $XDG_CONFIG_HOME/fish

View File

@ -32,7 +32,7 @@ fi
# install nvm # install nvm
if fish-is-default-shell; then if which fish 2>/dev/null; then
fish -c "fisher add jorgebucaran/nvm.fish" fish -c "fisher add jorgebucaran/nvm.fish"
else else
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash

View File

@ -16,15 +16,15 @@ fi
case "$PM" in case "$PM" in
apt) apt)
sudo apt install python3 python3-pip python-is-python3 sudo apt install python3 python3-pip python-is-python3
fish-is-default-shell && sudo pip3 install virtualfish which fish 2>/dev/null && sudo pip3 install virtualfish
;; ;;
pacman) pacman)
sudo pacman -S --needed python python-pip sudo pacman -S --needed python python-pip
fish-is-default-shell && sudo pip install virtualfish which fish 2>/dev/null && sudo pip install virtualfish
;; ;;
esac esac
# enable auto_activation plugin for virtualfish # enable auto_activation plugin for virtualfish
fish-is-default-shell && fish -c "yes | vf install && vf addplugins auto_activation" which fish 2>/dev/null && fish -c "yes | vf install && vf addplugins auto_activation"