diff --git a/setup-apt-fast b/setup-apt-fast index 944e528..6a50fd6 100755 --- a/setup-apt-fast +++ b/setup-apt-fast @@ -2,38 +2,40 @@ # House Keeping _GIT_DIR="${HOME}/data/gits" -if [ ! -d "${_GIT_DIR}" ]; then - mkdir -p "${_GIT_DIR}" -fi +mkdir -p "${_GIT_DIR}" cd "${_GIT_DIR}" # Initialization -if [ ! -d "${_GIT_DIR}/apt-fast" ]; then - git clone --depth 1 https://github.com/ilikenwf/apt-fast +if [[ -d "${_GIT_DIR}/apt-fast" ]]; then + echo "apt-fast is already installed!" + echo "Updating apt-fast..." cd apt-fast + git pull else + echo "Installing apt-fast..." + git clone --depth 1 https://github.com/ilikenwf/apt-fast cd apt-fast - git pull fi -# Installation +echo "Running build..." sudo cp apt-fast /usr/bin/ sudo chmod +x /usr/bin/apt-fast -if [ ! -f /etc/apt-fast.conf ]; then +if [[ ! -f /etc/apt-fast.conf ]]; then sudo cp apt-fast.conf /etc fi -# aria2 Plugin installation +echo "Installing dependencies..." sudo apt install aria2 -# Bash completion +echo "Setting up Bash completion..." sudo cp completions/bash/apt-fast /etc/bash_completion.d/ sudo chown root:root /etc/bash_completion.d/apt-fast source /etc/bash_completion -# Man page installation +echo "Setting up man page..." sudo cp ./man/apt-fast.8 /usr/share/man/man8 sudo gzip -f9 /usr/share/man/man8/apt-fast.8 sudo cp ./man/apt-fast.conf.5 /usr/share/man/man5 sudo gzip -f9 /usr/share/man/man5/apt-fast.conf.5 +echo "Done!" diff --git a/setup-cmus b/setup-cmus index 6671bd6..69c6e61 100755 --- a/setup-cmus +++ b/setup-cmus @@ -2,28 +2,31 @@ # House Keeping _GIT_DIR="${HOME}/data/gits" -if [ ! -d "${_GIT_DIR}" ]; then - mkdir -p "${_GIT_DIR}" -fi +mkdir -p "${_GIT_DIR}" cd "${_GIT_DIR}" # Initialization -if [ ! -d "${_GIT_DIR}/cmus" ]; then - git clone --depth 1 https://github.com/cmus/cmus +if [[ -d "${_GIT_DIR}/cmus" ]]; then + echo "cmus is already installed!" + echo "Updating cmus..." cd cmus + git pull else + echo "Installing cmus..." + git clone --depth 1 https://github.com/cmus/cmus cd cmus - git pull fi -# Install Dependencies -sudo apt install libroar-dev libsamplerate0-dev libjack-dev libavformat-dev libavcodec-dev libsystemd-dev libopusfile-dev libasound2-dev +echo "Installing dependencies..." +sudo apt install -y libroar-dev libsamplerate0-dev libjack-dev libavformat-dev libavcodec-dev libsystemd-dev libopusfile-dev libasound2-dev -# Installation +echo "Running build..." ./configure prefix=${HOME}/.local make make install -# Linking Binaries -sudo ln -sf ${HOME}/.local/bin/cmus /usr/bin/cmus -sudo ln -sf ${HOME}/.local/bin/cmus-remote /usr/bin/cmus-remote +echo "Setting up cmus binary: cmus, cmus-remote" +sudo ln -nsf ${HOME}/.local/bin/cmus /usr/bin/cmus +sudo ln -nsf ${HOME}/.local/bin/cmus-remote /usr/bin/cmus-remote + +echo "Done!" diff --git a/setup-cmusfm b/setup-cmusfm index 0f79057..63e16f7 100755 --- a/setup-cmusfm +++ b/setup-cmusfm @@ -2,28 +2,31 @@ # House Keeping _GIT_DIR="${HOME}/data/gits" -if [ ! -d "${_GIT_DIR}" ]; then - mkdir -p "${_GIT_DIR}" -fi +mkdir -p "${_GIT_DIR}" cd "${_GIT_DIR}" # Initialization -if [ ! -d "${_GIT_DIR}/cmusfm" ]; then - git clone --depth 1 https://github.com/Arkq/cmusfm +if [[ -d "${_GIT_DIR}/cmusfm" ]]; then + echo "cmusfm is already installed!" + echo "Updating cmusfm..." cd cmusfm + git pull else + echo "Installing cmusfm..." + git clone --depth 1 https://github.com/Arkq/cmusfm cd cmusfm - git pull fi -# Install Dependencies -sudo apt install automake libcurl4-openssl-dev libnotify-dev +echo "Installing dependencies..." +sudo apt install -y automake libcurl4-openssl-dev libnotify-dev -# Installation +echo "Running build..." autoreconf --install rm -rf build && mkdir build && cd build -../configure --prefix=${HOME}/.local --enable-libnotify +../configure --prefix="${HOME}/.local" --enable-libnotify make && make install -# Linking Binaries -sudo ln -sf ${HOME}/.local/bin/cmusfm /usr/bin/cmusfm +echo "Setting up cmusfm binary: cmusfm" +sudo ln -nsf ${HOME}/.local/bin/cmusfm /usr/bin/cmusfm + +echo "Done!" diff --git a/setup-drivesync b/setup-drivesync index 0a6ca3b..c9fe02c 100755 --- a/setup-drivesync +++ b/setup-drivesync @@ -4,19 +4,20 @@ # https://github.com/MStadlmeier/drivesync _drivesync_dir="${HOME}/.drivesync" -if [ -d "${_drivesync_dir}" ]; then + +if [[ -d "${_drivesync_dir}" ]]; then echo "DriveSync is already installed!" echo "Updating to the latest version..." cd ${_drivesync_dir} && git pull - echo "Running build..." - bundle install else echo "Installing DriveSync..." git clone https://github.com/MStadlmeier/drivesync ${_drivesync_dir} - echo "Running build..." - cd ${_drivesync_dir} && bundle install + cd ${_drivesync_dir} fi +echo "Running build..." +bundle install + _drivesync_entrypoint="${_drivesync_dir}/drivesync.rb" echo "Setting up DriveSync binary: drivesync" diff --git a/setup-hub b/setup-hub index cda8ec7..ded4d9b 100755 --- a/setup-hub +++ b/setup-hub @@ -3,12 +3,13 @@ # install/update hub # https://github.com/github/hub -echo "Getting the source for hub..." +echo "Installing hub..." + +echo "Getting the source..." go get -u github.com/github/hub +echo "Running build..." cd "${GOPATH}/src/github.com/github/hub" - -echo "Building hub from the source..." make install prefix="${HOME}/.local" echo "Done!" diff --git a/setup-neovim b/setup-neovim index 901580b..9e7492e 100755 --- a/setup-neovim +++ b/setup-neovim @@ -2,21 +2,31 @@ cd /tmp || exit +echo "Installing NeoVim..." _neovim_version=${1:-"nightly"} +_neovim_url="https://github.com/neovim/neovim/releases/download/${_neovim_version}/nvim.appimage" +_neovim_dir="/opt/neovim" -echo "Downloading NeoVim AppImage..." -wget -q https://github.com/neovim/neovim/releases/download/${_neovim_version}/nvim.appimage -O nvim.appimage +echo "Downloading AppImage..." +wget -qN --show-progress ${_neovim_url} -O nvim.appimage chmod u+x nvim.appimage -echo "Installing to /opt/neovim Directory..." -sudo mkdir -p /opt/neovim -sudo rm -rf /opt/neovim/nvim.appimage -sudo mv nvim.appimage /opt/neovim/ - -echo "Creating Symbolic Link..." -if [ -L "/usr/bin/nvim" ]; then - sudo rm -f /usr/bin/nvim +echo "Installation Directory: ${_neovim_dir}" +sudo mkdir -p ${_neovim_dir} +if [[ -f "${_neovim_dir}/nvim.appimage" ]]; then + sudo mv ${_neovim_dir}/nvim.appimage ${_neovim_dir}/nvim.appimage.old fi -sudo ln -s /opt/neovim/nvim.appimage /usr/bin/nvim +sudo mv nvim.appimage ${_neovim_dir}/nvim.appimage + +echo "Setting up NeoVim binary: nvim / vim" +sudo ln -nsf ${_neovim_dir}/nvim.appimage /usr/bin/nvim +ln -nsf /usr/bin/nvim ${HOME}/.local/bin/vim + +echo "Installing Plugin Manager: vim-plug" +_plug_url="https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim" +_plug_path="${HOME}/.config/nvim/autoload/plug.vim" + +echo "Downloading Plug vimscript..." +wget -qN --show-progress ${_plug_url} -O ${_plug_path} echo "Done!" diff --git a/setup-nvm b/setup-nvm index 1cee334..8b6b6bc 100755 --- a/setup-nvm +++ b/setup-nvm @@ -3,18 +3,21 @@ # install/update nvm # https://github.com/creationix/nvm -_NVM_DIR="${HOME}/.nvm" -if [ -d "${_NVM_DIR}" ]; then +_nvm_dir="${HOME}/.nvm" +if [[ -d "${_nvm_dir}" ]]; then ( - cd "${_NVM_DIR}" + echo "nvm is already installed!" + echo "Updating nvm..." + cd "${_nvm_dir}" git fetch origin git checkout $(git describe --abbrev=0 --tags --match "v[0-9]*" origin) - ) && source "${_NVM_DIR}/nvm.sh" + ) && source "${_nvm_dir}/nvm.sh" else ( - git clone https://github.com/creationix/nvm "${_NVM_DIR}" - cd "${_NVM_DIR}" + echo "Installing nvm..." + git clone https://github.com/creationix/nvm "${_nvm_dir}" + cd "${_nvm_dir}" git checkout $(git describe --abbrev=0 --tags --match "v[0-9]*" origin) - ) && source "${_NVM_DIR}/nvm.sh" + ) && source "${_nvm_dir}/nvm.sh" fi diff --git a/setup-popcorntime b/setup-popcorntime index 2dae3de..ad28367 100755 --- a/setup-popcorntime +++ b/setup-popcorntime @@ -2,26 +2,26 @@ cd /tmp || exit +echo "Installing PopcornTime..." _popcorntime_version=${1:-"0.3.10"} _popcorntime_platform=${2:-"Linux-64"} +_popcorntime_url="https://get.popcorntime.sh/build/Popcorn-Time-${_popcorntime_version}-${_popcorntime_platform}.tar.xz" +_popcorntime_dir="/opt/PopcornTime" -echo "Downloading PopcornTime Source Archive..." -wget -q --show-progress https://get.popcorntime.sh/build/Popcorn-Time-${_popcorntime_version}-${_popcorntime_platform}.tar.xz -O popcorntime.tar.xz +echo "Downloading Source Archive..." +wget -q --show-progress ${_popcorntime_url} -O popcorntime.tar.xz rm -rf PopcornTime && mkdir -p PopcornTime tar -Jxf popcorntime.tar.xz -C ./PopcornTime rm popcorntime.tar.xz -echo "Installing to /opt/PopcornTime Directory..." -if [ -d "/opt/PopcornTime" ]; then - sudo rm -rf /opt/PopcornTime +echo "Installation Directory: ${_popcorntime_dir}" +if [[ -d "${_popcorntime_dir}" ]]; then + sudo rm -rf ${_popcorntime_dir} fi -sudo mv PopcornTime /opt/PopcornTime +sudo mv PopcornTime ${_popcorntime_dir} -echo "Creating Symbolic Link..." -if [ -L "/usr/bin/popcorntime" ]; then - sudo rm -f /usr/bin/popcorntime -fi -sudo ln -s /opt/PopcornTime/Popcorn-Time /usr/bin/popcorntime +echo "Setting up PopcornTime binary: popcorntime" +sudo ln -nsf ${_popcorntime_dir}/Popcorn-Time /usr/bin/popcorntime echo "Adding Application Shortcut..." cat > ${HOME}/.local/share/applications/popcorntime.desktop < ${HOME}/.local/share/applications/postman.desktop < ${HOME}/.local/share/applications/postman.desktop <