Point dotfiles to install to /etc/skel.
This commit is contained in:
parent
7e1627bdaa
commit
d92ff80cfc
|
|
@ -23,42 +23,45 @@ chmod g-w /usr/local/share/zsh/site-functions
|
|||
cd ~ || exit
|
||||
chsh -s "$(which zsh)" "${USER}"
|
||||
|
||||
DEST=$HOME
|
||||
DEST=/etc/skel
|
||||
|
||||
apt-get install -y git
|
||||
# Install zgen plugin manager and zsh quicktart to get a default setup for zsh
|
||||
git clone http://github.com/tarjoilija/zgen # available with apt-get install zgen which installs to /usr/share/zgen
|
||||
git clone http://github.com/unixorn/zsh-quickstart-kit
|
||||
mkdir -p ~/.zgen/robbyrussell/
|
||||
git clone http://github.com/ohmyzsh/ohmyzsh ~/.zgen/robbyrussell/ohmyzsh
|
||||
mkdir -p ${DEST}/.zgen/robbyrussell/
|
||||
git clone http://github.com/ohmyzsh/ohmyzsh ${DEST}/.zgen/robbyrussell/ohmyzsh
|
||||
|
||||
ln -rsf ~/zsh-quickstart-kit/zsh/.zshrc ~/.zshrc
|
||||
ln -rsf ~/zsh-quickstart-kit/zsh/.zsh_functions ~/.zsh_functions
|
||||
ln -rsf ~/zsh-quickstart-kit/zsh/.zsh_aliases ~/.zsh_aliases
|
||||
ln -rsf ~/zsh-quickstart-kit/zsh/.zgen-setup ~/.zgen-setup
|
||||
ln -rsf ${DEST}/zsh-quickstart-kit/zsh/.zshrc ${DEST}/.zshrc
|
||||
ln -rsf ${DEST}/zsh-quickstart-kit/zsh/.zsh_functions ${DEST}/.zsh_functions
|
||||
ln -rsf ${DEST}/zsh-quickstart-kit/zsh/.zsh_aliases ${DEST}/.zsh_aliases
|
||||
ln -rsf ${DEST}/zsh-quickstart-kit/zsh/.zgen-setup ${DEST}/.zgen-setup
|
||||
#ln -rsf ~/zsh-quickstart-kit/zsh/.zsh_completions ~/.zsh_completions
|
||||
mkdir -p ~/.zshrc.d
|
||||
echo "setopt PROMPT_SUBST" >> ~/.zshrc
|
||||
mkdir -p ${DEST}/.zshrc.d
|
||||
echo "setopt PROMPT_SUBST" >> ${DEST}/.zshrc
|
||||
|
||||
|
||||
echo "NVIM_PYTHON_LOG_FILE=/var/tmp/nvim_python.log" >> ~/.zshrc.d/008_nvim.zsh
|
||||
echo "NVIM_PYTHON_LOG_LEVEL=DEBUG" >> ~/.zshrc.d/008_nvim.zsh
|
||||
echo "NVIM_PYTHON_LOG_FILE=/var/tmp/nvim_python.log" >> ${DEST}/.zshrc.d/008_nvim.zsh
|
||||
echo "NVIM_PYTHON_LOG_LEVEL=DEBUG" >> ${DEST}/.zshrc.d/008_nvim.zsh
|
||||
touch /var/tmp/nvim_python.log
|
||||
|
||||
# fix path error in .zshrc
|
||||
#sed -i 's|pushd $(dirname "${HOME}/$(readlink ~/.zshrc)")|pushd $(dirname "$(readlink ~/.zshrc)")|' ~/zsh-quickstart-kit/zsh/.zshrc
|
||||
#sed -i 's|pushd $(dirname "${HOME}/$(readlink ${DEST}/.zshrc)")|pushd $(dirname "$(readlink ${DEST}/.zshrc)")|' ${DEST}/zsh-quickstart-kit/zsh/.zshrc
|
||||
|
||||
# debians locate db locate
|
||||
# sed -i 's,^\(export LOCATE_PATH=\).*,\1'/var/lib/mlocate/mlocate.db',' ~/.zshrc
|
||||
echo "export LOCATE_PATH=/var/lib/mlocate/mlocate.db" > ~/.zshrc.d/005_locatedb.zsh
|
||||
# sed -i 's,^\(export LOCATE_PATH=\).*,\1'/var/lib/mlocate/mlocate.db',' ${DEST}/.zshrc
|
||||
echo "export LOCATE_PATH=/var/lib/mlocate/mlocate.db" > ${DEST}/.zshrc.d/005_locatedb.zsh
|
||||
|
||||
# add plugins to the load-starter-plugin-list() function in ~/.zgen-setup ~/zsh-quickstart-kit/zsh/.zgen-setup
|
||||
# FIXED: create a file named .zgen-local-plugins and add your zgen load commands there.
|
||||
# Don't forget to run `zgen save` at the end of your .zgen-local-plugins file.
|
||||
# Warning: .zgen-local-plugins REPLACES the starter list setup, it doesn't add to it.
|
||||
sed -i -e "s|zgen load srijanshetty/docker-zsh|# zgen load srijanshetty/docker-zsh|" ~/zsh-quickstart-kit/zsh/.zgen-setup
|
||||
sed -i '/\# zgen load srijanshetty\/docker-zsh/a\ \ zgen load oh-my-zsh plugins\/docker\n\ \ zgen load oh-my-zsh plugins\/docker-compose' ~/zsh-quickstart-kit/zsh/.zgen-setup
|
||||
sed -i -e "s|zgen load srijanshetty/docker-zsh|# zgen load srijanshetty/docker-zsh|" ${DEST}/zsh-quickstart-kit/zsh/.zgen-setup
|
||||
sed -i '/\# zgen load srijanshetty\/docker-zsh/a\ \ zgen load oh-my-zsh plugins\/docker\n\ \ zgen load oh-my-zsh plugins\/docker-compose' ${DEST}/zsh-quickstart-kit/zsh/.zgen-setup
|
||||
|
||||
# The contents of the starter plugin function with changes above, pulling from upstream git with now not squash local changes.
|
||||
cat > ~/.zgen-local-plugins << 'EOF'
|
||||
cat > ${DEST}/.zgen-local-plugins << 'EOF'
|
||||
echo "creating a zgen save"
|
||||
ZGEN_LOADED=()
|
||||
ZGEN_COMPLETIONS=()
|
||||
|
|
@ -200,36 +203,36 @@ EOF
|
|||
# example .d file use unset to prevent update
|
||||
#echo '# Use unset 'QUICKSTART_KIT_REFRESH_IN_DAYS' to disable.' > ~/.zshrc.d/001_quickstart-refresh.zsh
|
||||
#echo 'QUICKSTART_KIT_REFRESH_IN_DAYS=30' >> ~/.zshrc.d/001_quickstart-refresh.zsh
|
||||
echo 'ZGEN_PLUGIN_UPDATE_DAYS=30' > ~/.zshrc.d/001_zgen-refresh.zsh
|
||||
echo 'ZGEN_PLUGIN_UPDATE_DAYS=30' > ${DEST}/.zshrc.d/001_zgen-refresh.zsh
|
||||
|
||||
apt-get install -y fonts-powerline powerline
|
||||
# sed -i 's,^\(export LOCATE_PATH=\).*,\1'/var/lib/mlocate/mlocate.db',' ~/.zshrc
|
||||
|
||||
# Use powerline-daemon to speedup the prompt.
|
||||
echo 'powerline-daemon -q' > ~/.zshrc.d/006_powerline-daemon.zsh
|
||||
echo 'powerline-daemon -q' > ${DEST}/.zshrc.d/006_powerline-daemon.zsh
|
||||
|
||||
|
||||
sed -i 's,^\(CHARMAP=\).*,\1'\"UTF-8\"',' /etc/default/console-setup
|
||||
|
||||
# set theme for zsh
|
||||
cat > ~/.zshrc.d/002_theme.zsh << 'EOF'
|
||||
cat > ${DEST}/.zshrc.d/002_theme.zsh << 'EOF'
|
||||
# https://zshthem.es/browse-zsh-themes/
|
||||
ZSH_THEME="agnoster" # powerline based theme
|
||||
#ZSH_THEME="3den"
|
||||
#ZSH_THEME="Pure"
|
||||
EOF
|
||||
|
||||
cat > ~/.zshrc.d/001_vi-mode.sh << 'EOF'
|
||||
cat > ${DEST}/.zshrc.d/001_vi-mode.sh << 'EOF'
|
||||
# Set vi mode
|
||||
bindkey -v
|
||||
bindkey '^R' history-incremental-search-backward
|
||||
EOF
|
||||
|
||||
|
||||
#git clone https://github.com/bhilburn/powerlevel9k.git ~/.zgen/robbyrussell/oh-my-zsh-master/themes/powerlevel9k
|
||||
#git clone https://github.com/bhilburn/powerlevel9k.git ${DEST}/.zgen/robbyrussell/oh-my-zsh-master/themes/powerlevel9k
|
||||
|
||||
## add a separate zsh aliases directory
|
||||
#echo > ~/.zshrc << 'EOF'
|
||||
#echo > ${DEST}/.zshrc << 'EOF'
|
||||
## Make it easy to append your own aliases
|
||||
## loading all files from .zsh_aliases.d directory
|
||||
#mkdir -p ~/.zsh_aliases.d
|
||||
|
|
@ -244,13 +247,13 @@ EOF
|
|||
#EOF
|
||||
|
||||
# alias python version
|
||||
mkdir -p ~/.zsh_aliases.d
|
||||
mkdir -p ${DEST}/.zsh_aliases.d
|
||||
|
||||
# tell bash to check the next word after the alias (i.e sudo) by adding a space to the end of the alias value.
|
||||
echo "# tell bash to check the next word after the alias (i.e sudo) by adding a space to the end of the alias value." > ~/.zsh_aliases.d/002_sudo.zsh
|
||||
echo 'alias sudo="sudo "' >> ~/.zsh_aliases.d/002_sudo.zsh
|
||||
echo "# tell bash to check the next word after the alias (i.e sudo) by adding a space to the end of the alias value." > ${DEST}/.zsh_aliases.d/002_sudo.zsh
|
||||
echo 'alias sudo="sudo "' >> ${DEST}/.zsh_aliases.d/002_sudo.zsh
|
||||
|
||||
cat > ~/.zsh_aliases.d/003-py_aliases.zsh << 'EOF'
|
||||
cat > ${DEST}/.zsh_aliases.d/003-py_aliases.zsh << 'EOF'
|
||||
_py_version() {
|
||||
PY_VERSIONS=(2 3)
|
||||
|
||||
|
|
@ -287,7 +290,7 @@ alias ipython="_py_version"
|
|||
alias jupyter="_py_version"
|
||||
EOF
|
||||
|
||||
cat > .zsh_aliases.d/003_transfer.zsh <<'EOF'
|
||||
cat > ${DEST}/.zsh_aliases.d/003_transfer.zsh <<'EOF'
|
||||
#
|
||||
# Defines transfer alias and provides easy command line file and folder sharing.
|
||||
#
|
||||
|
|
|
|||
Loading…
Reference in New Issue