install-debian:sh added icdiff and fzf
Signed-off-by: Andreas Fendt <mail@andreas-fendt.de>
This commit is contained in:
parent
8c3a6b49e7
commit
91ef234482
@ -32,36 +32,44 @@ default_user=$(egrep '\:100[0-9]\:' /etc/passwd | tail -n 1 | awk -F':' '{print
|
|||||||
# install default packages
|
# install default packages
|
||||||
apt-get install -y sudo mc tree pv vim bash-completion wget git htop iotop iftop nmon apt-file aptitude hexedit tmux \
|
apt-get install -y sudo mc tree pv vim bash-completion wget git htop iotop iftop nmon apt-file aptitude hexedit tmux \
|
||||||
fonts-powerline
|
fonts-powerline
|
||||||
|
pip install git+https://github.com/jeffkaufman/icdiff.git
|
||||||
|
|
||||||
# zsh shell
|
# install zsh shell
|
||||||
apt-get install -y zsh && ( [ ! -d $root_user_path/.oh-my-zsh ] || [ ! -d $default_user_path/.oh-my-zsh ] ) && (
|
apt-get install -y zsh && (
|
||||||
# change shell
|
chsh -s /bin/zsh ${root_user}
|
||||||
chsh -s /bin/zsh $root_user
|
chsh -s /bin/zsh $[default_user]
|
||||||
chsh -s /bin/zsh $default_user
|
)
|
||||||
|
|
||||||
# install oh-my-zsh
|
# install oh-my-zsh
|
||||||
|
( [ ! -d ${root_user_path}/.oh-my-zsh ] || [ ! -d ${default_user_path}/.oh-my-zsh ] ) && (
|
||||||
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
|
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
|
||||||
|
|
||||||
# configure oh-my-zsh
|
# configure oh-my-zsh
|
||||||
grep 'ZSH_THEME="agnoster"' $root_user_path/.zshrc || sed -i -- 's/ZSH_THEME=".*"/ZSH_THEME="agnoster"/g' $root_user_path/.zshrc
|
grep 'ZSH_THEME="agnoster"' ${root_user_path}/.zshrc || sed -i -- 's/ZSH_THEME=".*"/ZSH_THEME="agnoster"/g' ${root_user_path}/.zshrc
|
||||||
grep "command-not-found" $root_user_path/.zshrc || sed -i -- '/^plugins=(/a \\ command-not-found\n common-aliases\n sudo\n systemd\n tmux\n ubuntu' $root_user_path/.zshrc
|
grep "command-not-found" ${root_user_path}/.zshrc || sed -i -- '/^plugins=(/a \\ command-not-found\n common-aliases\n sudo\n systemd\n tmux\n ubuntu' ${root_user_path}/.zshrc
|
||||||
|
|
||||||
# install oh-my-zsh to default user
|
# install oh-my-zsh to default user
|
||||||
cp $root_user_path/.zshrc $default_user_path/.zshrc
|
cp -f ${root_user_path}/.zshrc ${default_user_path}/.zshrc
|
||||||
cp -a $root_user_path/.oh-my-zsh $default_user_path/.oh-my-zsh
|
cp -a ${root_user_path}/.oh-my-zsh ${default_user_path}/.oh-my-zsh
|
||||||
chown ${default_user}:${default_user} ${default_user_path}/.oh-my-zsh ${default_user_path}/.zshrc
|
chown -R ${default_user}:${default_user} ${default_user_path}/.oh-my-zsh ${default_user_path}/.zshrc
|
||||||
|
sed -i -- '/Path to your oh-my-zsh installation/!b;n;c\ export ZSH='"${default_user_path}"'/.oh-my-zsh' ${default_user_path}/.zshrc
|
||||||
|
|
||||||
# configure tmux
|
# configure tmux
|
||||||
grep "ZSH_TMUX_AUTOSTART" $default_user_path/.zshrc || sed -i -- '1s/^/ZSH_TMUX_AUTOSTART="true"\nZSH_TMUX_AUTOQUIT="false"\n\n/' $default_user_path/.zshrc
|
grep "ZSH_TMUX_AUTOSTART" ${default_user_path}/.zshrc || sed -i -- '1s/^/ZSH_TMUX_AUTOSTART="true"\nZSH_TMUX_AUTOQUIT="false"\n\n/' ${default_user_path}/.zshrc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# install fzf
|
||||||
|
install_fzf='cd ~ && git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf && ~/.fzf/install'
|
||||||
|
[ ! -d ${root_user_path}/.fzf ] && su -c ${install_fzf} -s /bin/bash ${root_user}
|
||||||
|
[ ! -d ${default_user_path}/.fzf ] && su -c ${install_fzf} -s /bin/bash ${default_user}
|
||||||
|
|
||||||
# configure vim
|
# configure vim
|
||||||
touch ${root_user_path}/.vimrc ${default_user_path}/.vimrc
|
touch ${root_user_path}/.vimrc ${default_user_path}/.vimrc
|
||||||
for config in "filetype plugin indent on" "set tabstop=4" "set shiftwidth=4" \
|
for config in "filetype plugin indent on" "set tabstop=4" "set shiftwidth=4" \
|
||||||
"set expandtab" "syntax enable" "set softtabstop=4" \
|
"set expandtab" "syntax enable" "set softtabstop=4" \
|
||||||
"set number" "set showcmd" "set cursorline"; do
|
"set number" "set showcmd" "set cursorline"; do
|
||||||
grep "$config" ${root_user_path}/.vimrc || echo "$config" >> ${root_user_path}/.vimrc
|
grep "${config}" ${root_user_path}/.vimrc || echo "${config}" >> ${root_user_path}/.vimrc
|
||||||
grep "$config" ${default_user_path}/.vimrc || echo "$config" >> ${default_user_path}/.vimrc
|
grep "${config}" ${default_user_path}/.vimrc || echo "${config}" >> ${default_user_path}/.vimrc
|
||||||
done
|
done
|
||||||
chown ${default_user}:${default_user} ${default_user_path}/.vimrc
|
chown ${default_user}:${default_user} ${default_user_path}/.vimrc
|
||||||
|
|
||||||
@ -69,7 +77,7 @@ chown ${default_user}:${default_user} ${default_user_path}/.vimrc
|
|||||||
for config in "bind '\"' split-window -c \"#{pane_current_path}\"" \
|
for config in "bind '\"' split-window -c \"#{pane_current_path}\"" \
|
||||||
"bind % split-window -h -c \"#{pane_current_path}\"" \
|
"bind % split-window -h -c \"#{pane_current_path}\"" \
|
||||||
"bind c new-window -c \"#{pane_current_path}\""; do
|
"bind c new-window -c \"#{pane_current_path}\""; do
|
||||||
grep "$config" /etc/tmux.conf || echo "$config" >> /etc/tmux.conf
|
grep "${config}" /etc/tmux.conf || echo "${config}" >> /etc/tmux.conf
|
||||||
done
|
done
|
||||||
|
|
||||||
# configure system
|
# configure system
|
||||||
|
Loading…
Reference in New Issue
Block a user