From dc60e575af3cfa5833c1a2f692a84fdbab44b591 Mon Sep 17 00:00:00 2001 From: junikimm717 Date: Sat, 12 Mar 2022 14:49:19 -0500 Subject: [PATCH] fedora added --- graphical.sh => graphical_alpine.sh | 0 asroot.sh => root_alpine.sh | 0 asuser.sh => user_alpine.sh | 0 user_fedora.sh | 88 +++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+) rename graphical.sh => graphical_alpine.sh (100%) rename asroot.sh => root_alpine.sh (100%) rename asuser.sh => user_alpine.sh (100%) create mode 100644 user_fedora.sh diff --git a/graphical.sh b/graphical_alpine.sh similarity index 100% rename from graphical.sh rename to graphical_alpine.sh diff --git a/asroot.sh b/root_alpine.sh similarity index 100% rename from asroot.sh rename to root_alpine.sh diff --git a/asuser.sh b/user_alpine.sh similarity index 100% rename from asuser.sh rename to user_alpine.sh diff --git a/user_fedora.sh b/user_fedora.sh new file mode 100644 index 0000000..616d7f0 --- /dev/null +++ b/user_fedora.sh @@ -0,0 +1,88 @@ +#!/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 ! (type sudo 2>&1) > /dev/null; then + echo "sudo is not installed."; + exit 1 + fi + + echo "Updating DNF" + sudo dnf -y update || exit 1 + sudo dnf -y upgrade || exit 1 +} + +dev() { + echo "Developer tools..." + sudo dnf install -y git make python3 nodejs npm 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() { + sudo dnf install -y zsh starship +} + +browsers() { + sudo dnf remove -y firefox + sudo dnf install -y chromium torbrowser-launcher +} + +# 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 "$(wget -O- 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 +} + +competitiveprogramming() { + echo "CP Compilers..." + sudo dnf install clang clang-tools-extra + cd "$HOME" || exit 1; + git clone https://git.junickim.me/junikimm717/linuxcp "$HOME/cp" +} + +(usertest && dev && sysinfo && shell && plugins && dotfiles) || exit 1