Skip to content

Instantly share code, notes, and snippets.

@beruic
Last active January 23, 2019 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beruic/8ced09dc74e1b5a8d887bdc0658a8e3d to your computer and use it in GitHub Desktop.
Save beruic/8ced09dc74e1b5a8d887bdc0658a8e3d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
dpkg -s powerline > /dev/null
POWERLINE_INSTALLED=$?
if [[ "$POWERLINE_INSTALLED" -ne "0" ]]; then
sudo apt install powerline
#From https://powerline.readthedocs.io/en/master/usage/shell-prompts.html
read -r -d '' BASHRC_CONTENT <<- EOM
# Powerline
if [ -f /usr/share/powerline/bindings/bash/powerline.sh ]; then
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/share/powerline/bindings/bash/powerline.sh
fi
EOM
echo "$BASHRC_CONTENT" >> ~/.bashrc
# From https://github.com/powerline/powerline/issues/186#issuecomment-247810572
mkdir -p ~/.config/powerline
read -r -d '' POWERLINE_CONFIG <<- EOM
{
"ext": {
"shell": {
"theme": "default_leftonly"
}
}
}
EOM
echo "$POWERLINE_CONFIG" > ~/.config/powerline/config.json
# reload config
powerline-daemon --replace
echo "Restart terminal to enable powerline"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment