Skip to content

Instantly share code, notes, and snippets.

@onedomain
Last active May 2, 2019 16:20
Show Gist options
  • Save onedomain/9afd3eb3ea83818607ba254c09647443 to your computer and use it in GitHub Desktop.
Save onedomain/9afd3eb3ea83818607ba254c09647443 to your computer and use it in GitHub Desktop.
To install: $ curl -o- -L http://a.1auth.pw/install-bashit | bash
#!/bin/bash
if [ -f ~/.bashrc ]; then
if [ -f /usr/local/bin/bash ]; then
echo 'setting shell to /usr/local/bin/bash'
chsh -s /usr/local/bin/bash
elif [ -f /usr/bin/bash ]; then
echo 'setting shell to /usr/bin/bash'
chsh -s /usr/bin/bash
else
echo 'setting shell to /bin/bash'
chsh -s /bin/bash
fi
else
if [ -f /usr/local/bin/zsh ]; then
echo 'setting shell to /usr/local/bin/zsh'
chsh -s /usr/local/bin/zsh
elif [ -f /usr/bin/zsh ]; then
echo 'setting shell to /usr/bin/zsh'
chsh -s /usr/bin/zsh
else
echo 'setting shell to /bin/zsh'
chsh -s /bin/zsh
fi
fi
sleep 1
echo '$ git clone https://github.com/akinomyoga/ble.sh.git $HOME/.ble.sh'
git clone -q https://github.com/akinomyoga/ble.sh.git $HOME/ble.sh
sleep 1
echo '$ git clone --depth=1 https://github.com/Bash-it/bash-it.git $HOME/.bash_it'
git clone -q --depth=1 https://github.com/Bash-it/bash-it.git $HOME/.bash_it
sleep 1
echo 'installing bash-it...'
$HOME/.bash_it/install.sh --silent
sleep 1
echo 'installing ble.sh...'
make --quiet -C $HOME/ble.sh
mv $HOME/ble.sh/out $HOME/.bash_it && rm -rf $HOME/ble.sh
sleep 1
echo 'updating .bashrc...'
sed -i -e 's/^source \"\$BASH\_IT\"\/bash\_it\.sh//g' $HOME/.bashrc
echo '' >> $HOME/.bashrc
echo '# initializing ble.sh before bash-it...' >> $HOME/.bashrc
echo '[[ $- == *i* ]] || return 0' >> $HOME/.bashrc
echo 'source /root/.bash_it/out/ble.sh --noattach' >> $HOME/.bashrc
echo '' >> $HOME/.bashrc
echo '# user settings...' >> $HOME/.bashrc
echo 'source "$BASH_IT"/bash_it.sh' >> $HOME/.bashrc
echo '((_ble_bash)) && ble-attach' >> $HOME/.bashrc
source $HOME/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment