diff --git a/user_alpine.sh b/user_alpine.sh index 0d80388..e8db098 100755 --- a/user_alpine.sh +++ b/user_alpine.sh @@ -68,7 +68,8 @@ plugins() { # install vim-plug, oh-my-zsh, and zsh-syntax-highlighting sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' - sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" } diff --git a/user_ubuntu.sh b/user_ubuntu.sh index 2775132..8cae24e 100755 --- a/user_ubuntu.sh +++ b/user_ubuntu.sh @@ -101,7 +101,7 @@ plugins() { # install vim-plug, oh-my-zsh, and zsh-syntax-highlighting sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' - sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" } diff --git a/user_void.sh b/user_void.sh new file mode 100755 index 0000000..a50848f --- /dev/null +++ b/user_void.sh @@ -0,0 +1,81 @@ +#!/bin/sh + +DIR="$(realpath "$(dirname "$0")")" + +# script must start at home directory +cd "$HOME" || exit 1; + +usertest() { + if test "$(id -u)" -eq 0; then + echo "You cannot run this script as root."; + exit 1; + fi + if ! (getent passwd junikim 2>&1) > /dev/null; then + echo "User junikim must exist."; + exit 1 + fi +} + +dev() { + echo "Developer tools..." + sudo xbps-install -Sy make python3 nodejs neovim curl +} + + +sysinfo() { + echo "Dylan Araps scripts" + cd "$HOME" || exit 1; + mkdir -p repos + git clone https://github.com/dylanaraps/pfetch "$HOME/repos/pfetch" + git clone https://github.com/dylanaraps/neofetch "$HOME/repos/neofetch" + git clone https://github.com/dylanaraps/fff "$HOME/repos/fff" + + cd "$HOME/repos/pfetch" || exit 1; + sudo make install || exit 2; + cd "$HOME" || exit 1; + + cd "$HOME/repos/neofetch" || exit 1; + sudo make install || exit 2; + cd "$HOME" || exit 1; + + cd "$HOME/repos/fff" || exit 1; + sudo make install || exit 2; + cd "$HOME" || exit 1; +} + +shell() { + echo "zsh installation and configuration as login shell" + sudo xbps-install -Sy zsh starship + chsh -s /bin/zsh +} + +# neovim must be installed. +plugins() { + # install vim-plug, oh-my-zsh, and zsh-syntax-highlighting + sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \ + https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" + git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" +} + +dotfiles() { + echo "Adding vim and zsh configs" + if ! test -d "$DIR/dotfiles"; then + echo "$DIR/dotfiles folder not found."; + exit 1; + fi + mkdir -p "$HOME/.config/nvim" + cp "$DIR/dotfiles/.zshrc" "$HOME/.zshrc" + cp "$DIR/dotfiles/init.vim" "$HOME/.config/nvim/init.vim" + nvim --headless +PlugInstall +qa +} + +(usertest && dev && sysinfo && shell && plugins && dotfiles) || exit 1 + +cat <