Created
April 12, 2019 19:13
-
-
Save supernovel/ba381b31eaa53576c153501634859904 to your computer and use it in GitHub Desktop.
wsl에서 oh-my-zsh 설정
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# oh-my-zsh setting for wsl | |
font_name="DejaVuSansMono" | |
font_dir="$HOME/.local/share/fonts/NerdFonts" | |
exclude_str=".*Windows.*" | |
setting_text=" | |
POWERLEVEL9K_MODE=\"nerdfont-complete\" | |
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(time user dir_writable dir vcs status) | |
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=() | |
POWERLEVEL9K_PROMPT_ON_NEWLINE=true | |
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true | |
POWERLEVEL9K_MULTILINE_FIRST_PROMPT_PREFIX=\"\" | |
POWERLEVEL9K_MULTILINE_LAST_PROMPT_PREFIX=\"$ \" | |
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND=\"white\" | |
POWERLEVEL9K_USER_DEFAULT_BACKGROUND=\"cyan\" | |
POWERLEVEL9K_USER_DEFAULT_FOREGROUND=\"black\" | |
POWERLEVEL9K_STATUS_OK_BACKGROUND=\"grey37\" | |
POWERLEVEL9K_STATUS_ERROR_BACKGTOUND=\"grey37\" | |
" | |
# install git & zsh | |
echo 'installing git & zsh & unzip & fontconfig' | |
sudo apt-get install -y git zsh unzip fontconfig | |
# install oh-my-zsh | |
echo 'installing oh-my-zsh' | |
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)" | |
# download fonts | |
echo "download ${font_name} fonts" | |
wget "https://github.com/ryanoasis/nerd-fonts/releases/download/v2.0.0/${font_name}.zip" | |
# unzip fonts | |
mkdir "${font_name}" | |
mkdir "${font_dir}" | |
echo "installing ${font_name} fonts" | |
echo "font dir : ${font_dir}" | |
unzip "${font_name}.zip" -d "${font_name}" | |
# copy fonts | |
cd "${font_name}" | |
for entry in * | |
do | |
if [ $(expr match "${entry}" "${exclude_str}") -eq 0 ] | |
then | |
echo "copy font ${entry} -> ${font_dir}/${entry}" | |
cp "${entry}" "${font_dir}/${entry}" | |
fi | |
done | |
fc-cache -vf "${font_dir}" | |
# clean up | |
cd .. | |
rm -rf ${font_name} "${font_name}.zip" | |
# install powerlevel10k theme | |
echo 'installing powerlevel10k theme' | |
sudo git clone https://github.com/romkatv/powerlevel10k.git ~/.oh-my-zsh/custom/themes/powerlevel10k | |
echo "$setting_text" >> ~/.zshrc | |
sed -i 's/^ZSH_THEME=.*$/ZSH_THEME=powerlevel10k\/powerlevel10k/' ~/.zshrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
font
DejaVuSansMono
image