diff --git a/ubuntu/install-base.sh b/ubuntu/install-base.sh new file mode 100755 index 0000000..6f8d26e --- /dev/null +++ b/ubuntu/install-base.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo apt update +sudo apt upgrade --fix-missing +sudo apt install fish build-essential automake pkg-config libevent-dev libncurses5-dev software-properties-common curl -y diff --git a/ubuntu/install-fish.sh b/ubuntu/install-fish.sh new file mode 100755 index 0000000..5375321 --- /dev/null +++ b/ubuntu/install-fish.sh @@ -0,0 +1,9 @@ +sudo add-apt-repository ppa:fish-shell/release-3 -y +sudo apt update +sudo apt install fish -y + +DEFAULT_SHELL=$(getent passwd $USER | cut -d: -f7) +FISH_SHELL=$(which fish) +if [ "$DEFAULT_SHELL" != "$FISH_SHELL" ]; then +chsh -s $FISH_SHELL +fi diff --git a/ubuntu/install-sources.sh b/ubuntu/install-sources.sh new file mode 100755 index 0000000..3c40b89 --- /dev/null +++ b/ubuntu/install-sources.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +if [ ! -e /etc/apt/sources.bak ]; then + sudo mv /etc/apt/sources.list /etc/apt/sources.bak + + CURRENT_CODENAME=$(lsb_release -c | cut -f2) + SOURCE_CODENAME=$(head -n 1 $DIR/sources.list | cut -d' ' -f3) + if [ "$CURRENT_CODENAME" != "$SOURCE_CODENAME" ]; then + sudo bash -c "cat $DIR/sources.list | sed s/$SOURCE_CODENAME/$CURRENT_CODENAME/g > /etc/apt/sources.list" + else + sudo cp $DIR/sources.list /etc/apt/ + fi +fi diff --git a/ubuntu/install-tmux.sh b/ubuntu/install-tmux.sh new file mode 100755 index 0000000..44bc2a4 --- /dev/null +++ b/ubuntu/install-tmux.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +TMUX_VER=3.1b +curl -L https://github.com/tmux/tmux/releases/download/$TMUX_VER/tmux-$TMUX_VER.tar.gz -o /tmp/tmux.tar.gz +cd /tmp/ +tar zxvf tmux.tar.gz +cd tmux-$TMUX_VER +./configure && make +sudo make install +cd +rm -rf /tmp/tmux-$TMUX_VER +rm -rf /tmp/tmux.tar.gz diff --git a/ubuntu/install-vim.sh b/ubuntu/install-vim.sh new file mode 100755 index 0000000..916b530 --- /dev/null +++ b/ubuntu/install-vim.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sudo add-apt-repository ppa:jonathonf/vim -y +sudo apt update +sudo apt install -y vim diff --git a/ubuntu/setup.sh b/ubuntu/setup.sh index f36e138..b42f40f 100755 --- a/ubuntu/setup.sh +++ b/ubuntu/setup.sh @@ -1,43 +1,9 @@ #!/bin/bash DIR=$(dirname "${BASH_SOURCE[0]}") -if [ ! -e /etc/apt/sources.bak ]; then - sudo mv /etc/apt/sources.list /etc/apt/sources.bak - CURRENT_CODENAME=$(lsb_release -c | cut -f2) - SOURCE_CODENAME=$(head -n 1 $DIR/sources.list | cut -d' ' -f3) - if [ "$CURRENT_CODENAME" != "$SOURCE_CODENAME" ]; then - sudo bash -c "cat $DIR/sources.list | sed s/$SOURCE_CODENAME/$CURRENT_CODENAME/g > /etc/apt/sources.list" - else - sudo cp $DIR/sources.list /etc/apt/ - fi -fi - -sudo add-apt-repository ppa:jonathonf/vim -y -sudo add-apt-repository ppa:fish-shell/release-3 -y -sudo apt-get update -sudo apt-get upgrade --fix-missing -sudo apt-get install vim fish build-essential automake pkg-config libevent-dev libncurses5-dev software-properties-common curl -y - -TMUX_VER=3.1b -curl -L https://github.com/tmux/tmux/releases/download/$TMUX_VER/tmux-$TMUX_VER.tar.gz -o /tmp/tmux.tar.gz -cd /tmp/ -tar zxvf tmux.tar.gz -cd tmux-$TMUX_VER -./configure && make -sudo make install -cd -rm -rf /tmp/tmux-$TMUX_VER -rm -rf /tmp/tmux.tar.gz - -#if uname -r | grep "Microsoft" -q; then - #if ! grep fish ~/.bashrc -q; then - #cat $DIR/wsl.sh >> ~/.bashrc - #fi -#else - DEFAULT_SHELL=$(getent passwd $USER | cut -d: -f7) - FISH_SHELL=$(which fish) - if [ "$DEFAULT_SHELL" != "$FISH_SHELL" ]; then - chsh -s $FISH_SHELL - fi -#fi +$DIR/install-sources.sh +$DIR/install-base.sh +$DIR/install-fish.sh +$DIR/install-vim.sh +$DIR/install-tmux.sh diff --git a/ubuntu/sources.list b/ubuntu/sources.list old mode 100755 new mode 100644