Skip to content

Instantly share code, notes, and snippets.

@kereis
Created March 28, 2020 12:16
Show Gist options
  • Save kereis/763c28f0066416a6086686ce95ba9151 to your computer and use it in GitHub Desktop.
Save kereis/763c28f0066416a6086686ce95ba9151 to your computer and use it in GitHub Desktop.
Quick setup customization script for Windows Subsystem Linux
#!/bin/bash
# In Windows 10:
# powershell -command Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
fi
# Switch to tmp dir as workdir
cd /tmp/
# Setup Powerline font
apt install -y fontconfig
wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
mkdir -p ~/.local/share/fonts/
mkdir -p ~/.config/fontconfig/conf.d/
mv PowerlineSymbols.otf ~/.local/share/fonts/
fc-cache -vf ~/.local/share/fonts/
mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
# Setup zsh + oh-my-zsh
apt install -y zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
# Configure .zshrc
sed -i "s/ZSH_THEME=\"robbyrussell\"/ZSH_THEME=\"powerlevel9k\/powerlevel9k\"/g" metamorphosis.txt
echo POWERLEVEL9K_MODE='nerdfont-complete' > ~/.zshrc
echo POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(context dir dir_writable vcs vi_mode) > ~/.zshrc
echo POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status) > ~/.zshrc
echo POWERLEVEL9K_PROMPT_ON_NEWLINE=true > ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment