├── .github └── workflows │ └── shellcheck.yml ├── .gitignore ├── LICENSE ├── README.md ├── linux-script.sh └── src ├── assets ├── arch-linux-logo.png ├── fedora-logo.png ├── linux-tux.png └── ubuntu-logo.webp ├── lib ├── arch-base-script.sh ├── base-script.sh ├── fedora-base-script.sh ├── install-package.sh ├── title-templates.sh └── ubuntu-base-script.sh ├── scripts ├── arch-script.sh ├── fedora-script.sh ├── ubuntu-script.sh ├── wsl-arch-script.sh └── wsl-ubuntu-script.sh └── utils └── git-gpg-ssh-setup.sh /.github/workflows/shellcheck.yml: -------------------------------------------------------------------------------- 1 | # https://github.com/koalaman/shellcheck/wiki/GitHub-Actions 2 | name: Differential ShellCheck 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | permissions: 10 | contents: read 11 | 12 | jobs: 13 | lint: 14 | runs-on: ubuntu-latest 15 | 16 | permissions: 17 | # required for all workflows 18 | security-events: write 19 | 20 | # only required for workflows in private repositories 21 | actions: read 22 | contents: read 23 | 24 | steps: 25 | - name: Repository checkout 26 | uses: actions/checkout@v4 27 | with: 28 | fetch-depth: 0 29 | 30 | - name: Differential ShellCheck 31 | uses: redhat-plumbers-in-action/differential-shellcheck@v5 32 | with: 33 | token: ${{ secrets.GITHUB_TOKEN }} 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore WSL2 moved files 2 | **.Identifier 3 | # In case the fonts folder is not in the right place 4 | fonts/ 5 | # Some random signing keys may appear 6 | **.gpg 7 | 8 | # User folder incorrectly created 9 | **/~ 10 | # Oh My ZSH folder incorrectly created 11 | **/.oh-my-zsh -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Plínio Larrubia 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | Linux Script 4 | 5 | [![Differential ShellCheck](https://github.com/LeDragoX/linux-script/actions/workflows/shellcheck.yml/badge.svg?branch=main&style=flat)](https://github.com/LeDragoX/linux-script/actions/workflows/shellcheck.yml) 6 | 7 |

8 | 9 | **_Script that configure my Linux post-install._** 10 | 11 | ## ⚙️ Setup Requirements 12 | 13 | Open the terminal and paste these lines: 14 | 15 |

16 | 17 | ### Arch-like 18 | 19 |
20 | 21 | **This was made to install after you've runned the `archinstall` command and set up at least a minimal install before** 22 | 23 | ```sh 24 | sudo pacman -Sy --needed --noconfirm curl rsync reflector git 25 | ``` 26 | 27 | #### **⚠️ Get Fastest Mirrors (Arch only)** 28 | 29 | Reflector allows Arch to get the fastest mirrors for package downloading. 30 | 31 | _**Note:** If you are not in Brazil, then change "BR" to your own country/code._ 32 | 33 | ```sh 34 | sudo reflector --country BR,AR,CL,EC,PY,US,CA,MX --sort rate --save /etc/pacman.d/mirrorlist 35 | ``` 36 | 37 | ### ArchWSL ~ [Project Link](https://github.com/yuk7/ArchWSL) 38 | 39 | These steps are for ArchWSL only. 40 | 41 | ```sh 42 | # Fix 'git: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by git)' 43 | sudo pacman -Sy --noconfirm archlinux-keyring git glibc 44 | ``` 45 | 46 | #### ❔ Notes for ArchWSL (Based on [THEIR](https://wsldl-pg.github.io/ArchW-docs/How-to-Setup/) wiki) 47 | 48 | 1. Open the `linux-script.sh`, 49 | 2. Select `[MENU] Arch for WSL` option, 50 | 3. Then `[WSL] ArchWSL setup Root and User` for setting root/user accounts 51 | 1. Close the Terminal window; 52 | 2. Open powershell and type `Arch.exe config --default-user <>`; 53 | 4. Then reopen the terminal and run steps 1-2 to select `[WSL] ArchWSL Post Configurations (Workflow)` for environment config. 54 | 55 |
56 | 57 |

58 | 59 | ### Fedora 60 | 61 |
62 | 63 | Get `git` for Fedora: 64 | 65 | ```sh 66 | sudo dnf install -y git 67 | ``` 68 | 69 |
70 | 71 |

72 | 73 | ### Ubuntu-like or WSL2 74 | 75 |
76 | 77 | Get `git` for Ubuntu: 78 | 79 | ```sh 80 | sudo apt install -y git 81 | ``` 82 | 83 |
84 | 85 |

86 | 87 | ## 🚀 Usage 88 | 89 | > **_Never sudo this script, OKAY? It requests sudo when needed_** 90 | 91 | ```sh 92 | mkdir --parents ~/Downloads 93 | git clone https://github.com/LeDragoX/LinuxScript.git ~/Downloads/linux-script 94 | cd ~/Downloads/linux-script/ 95 | chmod --recursive +x *.sh # Current folder files 96 | chmod --recursive +x **/**/*.sh # Check all folders inside the current folder 97 | bash --login ./linux-script.sh 98 | ``` 99 | 100 | > [!NOTE] 101 | > This script was made following these conventions: 102 | > 103 | > - (while writing code) 104 | > - 105 | > - 106 | 107 |
108 | 109 | ## 📦 Installed Packages 110 | 111 | ### _ ALL Distros_ 112 | 113 | | Package | All Distros | 114 | | :-------: | :---------: | 115 | | asdf | ✔️ | 116 | | curl wget | ✔️ | 117 | | git | ✔️ | 118 | | nvm | ✔️ | 119 | | rvm | ✔️ | 120 | | unzip zip | ✔️ | 121 | | which | ✔️ | 122 | | zsh | ✔️ | 123 | 124 | ### Flatpak 125 | 126 | These packages will be installed in Arch and Fedora Desktop versions: 127 | 128 | | Package | Verified | 129 | | :---------------------------: | :------: | 130 | | dev.vencord.Vesktop | ✅ | 131 | | org.onlyoffice.desktopeditors | ✅ | 132 | | app.xemu.xemu | ❌ | 133 | | io.github.ryubing.Ryujinx | ❌ | 134 | | net.kuribo64.melonDS | ✅ | 135 | | net.pcsx2.PCSX2 | ✅ | 136 | | net.rpcs3.RPCS3 | ❌ | 137 | | net.shadps4.shadPS4 | ✅ | 138 | | org.DolphinEmu.dolphin-emu | ❌ | 139 | | org.duckstation.DuckStation | ✅ | 140 | | org.libretro.RetroArch | ✅ | 141 | | org.ppsspp.PPSSPP | ✅ | 142 | 143 | ### _ Arch_ 144 | 145 | | Package | Arch | Arch (WSL2) | 146 | | :------------------------------------------------------------------------- | :------------: | :---------: | 147 | | archlinux-keyring (Essential) | ✔️ | ✔️ | 148 | | adobe-source-han-sans-cn/hk/jp/kr/otc/tw-fonts noto-fonts-emoji ttf-dejavu | ✔️ | ❌ | 149 | | amd-ucode intel-ucode | ✔️ | ❌ | 150 | | arc-gtk-theme | ✔️ | ❌ | 151 | | base-devel | ✔️ | ✔️ | 152 | | code | ✔️ Snap | ❌ | 153 | | discord | ❌ Opt-out | ❌ | 154 | | emote | ✔️ Snap | ❌ | 155 | | exfatprogs | ✔️ | ❌ | 156 | | fastfetch | ✔️ | ❌ | 157 | | file-roller | ✔️ | ❌ | 158 | | gimp | ✔️ | ❌ | 159 | | google-chrome | ❌ AUR Opt-out | ❌ | 160 | | gnome-keyring | ✔️ | ❌ | 161 | | gparted | ✔️ | ❌ | 162 | | grub-customizer os-prober | ✔️ | ❌ | 163 | | htop | ✔️ | ❌ | 164 | | lib32-pipewire pipewire pipewire-alsa/jack/pulse wireplumber | ✔️ | ❌ | 165 | | microsoft-edge-stable-bin | ✔️ AUR | ❌ | 166 | | man-db man-pages | ✔️ | ✔️ | 167 | | nano vim | ✔️ | ❌ | 168 | | ntfs-3g | ✔️ | ❌ | 169 | | fastfetch | ✔️ | ❌ | 170 | | obs-studio | ✔️ | ❌ | 171 | | parsec-bin | ✔️ AUR | ❌ | 172 | | pavucontrol | ✔️ | ❌ | 173 | | python-pip | ✔️ | ❌ | 174 | | qbittorrent | ✔️ | ❌ | 175 | | scrcpy | ✔️ | ❌ | 176 | | slack | ✔️ Snap | ❌ | 177 | | spotify-adblock-git | ✔️ AUR | ❌ | 178 | | svp | ✔️ AUR | ❌ | 179 | | vlc | ✔️ | ❌ | 180 | | snapd yay | ✔️ | ✔️ | 181 | 182 | ### _ Optional_ 183 | 184 |
185 | 186 | #### NVIDIA Users 187 | 188 | | Package | Arch | Arch (WSL2) | 189 | | :-------------------------------------------------: | :--: | :---------: | 190 | | cuda lib32-nvidia-utils nvidia/-lts nvidia-settings | ✔️ | ❌ | 191 | 192 | #### SVP Install 193 | 194 | | Package | Arch | Arch (WSL2) | 195 | | :------------------------------------------------------------: | :----: | :---------: | 196 | | libmediainfo lsof qt5-base qt5-declarative qt5-svg vapoursynth | ✔️ | ❌ | 197 | | mpv-full rsound spirv-cross svp | ✔️ AUR | ❌ | 198 | 199 |
200 | 201 | ### _ Ubuntu_ 202 | 203 | | Package | Require GPG/PPA | Ubuntu | Ubuntu (WSL2) | 204 | | :--------------------------------------------------------- | :-------------: | :--------: | :-----------: | 205 | | adb fastboot scrcpy | ❌ | ✔️ | ❌ | 206 | | apt-transport-https code | ❌/GPG | ✔️ | ❌ | 207 | | build-essential | ❌ | ✔️ | ✔️ | 208 | | discord | ❌ | ✔️ Deb | ❌ | 209 | | file-roller | ❌ | ✔️ | ❌ | 210 | | gdebi gdebi-core | ❌ | ✔️ | ✔️ | 211 | | gimp | ✔️ PPA | ✔️ | ❌ | 212 | | google-chrome-stable | ✔️ GPG | ❌ Opt-out | ❌ | 213 | | gparted | ❌ | ✔️ | ❌ | 214 | | grub-customizer grub-efi grub2-common os-prober | ✔️ PPA/❌/❌/❌ | ✔️ | ❌ | 215 | | htop | ❌ | ✔️ | ✔️ | 216 | | pipewire pipewire-pulse/audio-client-libraries wireplumber | ❌ | ✔️ | ✔️ | 217 | | gstreamer1.0-pipewire libspa-0.2-bluetooth libspa-0.2-jack | ❌ | ✔️ | ✔️ | 218 | | microsoft-edge-stable | ✔️ GPG | ✔️ | ❌ | 219 | | neofetch | ❌ | ✔️ | ✔️ | 220 | | ntfs-3g | ❌ | ✔️ | ❌ | 221 | | nvidia-driver-xxx | ❌ | ✔️ v525 | ❌ | 222 | | obs-studio | ✔️ PPA | ✔️ | ❌ | 223 | | onlyoffice-desktopeditors | ❌ | ✔️ Deb | ❌ | 224 | | parsec-bin | ❌ | ✔️ Deb | ❌ | 225 | | pavucontrol | ❌ | ✔️ | ❌ | 226 | | pip | ❌ | ✔️ | ❌ | 227 | | qbittorrent | ✔️ PPA | ✔️ | ❌ | 228 | | spotify-client | ✔️ GPG | ✔️ | ❌ | 229 | | nano vim | ❌ | ✔️ | ✔️ | 230 | | vlc | ❌ | ✔️ | ❌ | 231 | 232 |
233 | 234 | ## 📝 License 235 | 236 | Licensed under the [MIT](LICENSE) license. 237 | -------------------------------------------------------------------------------- /linux-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/base-script.sh 4 | 5 | function initial_main_menu() { 6 | script_logo 7 | PS3="Select an option to see the scripts: " 8 | select option in "Exit" "[MENU] Arch (Desktop)" "[MENU] Arch (WSL)" "Fedora (Desktop)" "Ubuntu (Desktop)" "Ubuntu (WSL)" "Utilities Scripts"; do 9 | echo "You choose $option" 10 | case $option in 11 | "Exit") 12 | clear 13 | echo "Exiting..." && echo 14 | break 15 | ;; 16 | "[MENU] Arch (Desktop)") 17 | clear 18 | echo_caption "Arch" 19 | ./"src/scripts/arch-script.sh" 20 | ;; 21 | "[MENU] Arch (WSL)") 22 | clear 23 | echo_caption "Arch" 24 | ./"src/scripts/wsl-arch-script.sh" 25 | ;; 26 | "Fedora (Desktop)") 27 | clear 28 | echo_caption "Fedora" 29 | ./"src/scripts/fedora-script.sh" 30 | ;; 31 | "Ubuntu (Desktop)") 32 | clear 33 | echo_caption "Ubuntu" 34 | ./"src/scripts/ubuntu-script.sh" 35 | ;; 36 | "Ubuntu (WSL)") 37 | clear 38 | echo_caption "Ubuntu" 39 | ./"src/scripts/wsl-ubuntu-script.sh" 40 | ;; 41 | "Utilities Scripts") 42 | clear 43 | echo_caption "Utilities" 44 | utilities_menu 45 | ;; 46 | *) 47 | clear 48 | echo_error "ERROR: Invalid Option" 49 | initial_main_menu 50 | break 51 | ;; 52 | esac 53 | break 54 | done 55 | } 56 | 57 | function utilities_menu() { 58 | PS3="Select the script: " 59 | select script in "Go Back" "Setup GPG and SSH for GitHub" "Install ZSH + Oh My ZSH"; do 60 | echo "You chose the $script" 61 | case $script in 62 | "Go Back") 63 | clear 64 | main 65 | ;; 66 | "Setup GPG and SSH for GitHub") 67 | clear 68 | echo_caption "Git, GPG and SSH setup (UTILS)" 69 | ./src/utils/git-gpg-ssh-setup.sh 70 | ;; 71 | "Install ZSH + Oh My ZSH") 72 | clear 73 | echo_caption "Setting Up ZSH + Oh My ZSH" 74 | install_zsh 75 | install_oh_my_zsh 76 | ;; 77 | *) 78 | clear 79 | echo_error "ERROR: Invalid Option" 80 | utilities_menu 81 | ;; 82 | esac 83 | break 84 | done 85 | } 86 | 87 | function main() { 88 | clear 89 | initial_main_menu 90 | echo "EXIT CODE: $?" 91 | } 92 | 93 | main 94 | -------------------------------------------------------------------------------- /src/assets/arch-linux-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LeDragoX/linux-script/202d14c33bf1c5d5574d9c047d6b4375a8ae91ef/src/assets/arch-linux-logo.png -------------------------------------------------------------------------------- /src/assets/fedora-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LeDragoX/linux-script/202d14c33bf1c5d5574d9c047d6b4375a8ae91ef/src/assets/fedora-logo.png -------------------------------------------------------------------------------- /src/assets/linux-tux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LeDragoX/linux-script/202d14c33bf1c5d5574d9c047d6b4375a8ae91ef/src/assets/linux-tux.png -------------------------------------------------------------------------------- /src/assets/ubuntu-logo.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/LeDragoX/linux-script/202d14c33bf1c5d5574d9c047d6b4375a8ae91ef/src/assets/ubuntu-logo.webp -------------------------------------------------------------------------------- /src/lib/arch-base-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/base-script.sh 4 | source ./src/lib/install-package.sh 5 | source ./src/lib/title-templates.sh 6 | 7 | function install_package_managers() { 8 | echo_title "Installing Package Managers (Yay, Snap)" 9 | 10 | echo_caption "Enabling Yay" 11 | git clone https://aur.archlinux.org/yay.git /tmp/yay 12 | pushd /tmp/yay/ || exit 13 | makepkg --syncdeps --install --clean --noconfirm # Like dpkg 14 | popd || exit # ~/.config/ledragox-linux-script 15 | 16 | config_environment 17 | echo_caption "Enabling Snap repository" 18 | git clone https://aur.archlinux.org/snapd.git ~/"$CONFIG_FOLDER"/snapd 19 | pushd ~/"$CONFIG_FOLDER"/snapd || exit 20 | makepkg --syncdeps --install --clean --noconfirm 21 | popd || exit 22 | sudo systemctl enable --now snapd.socket # Enable Snap Socket 23 | sudo ln -s /var/lib/snapd/snap /snap # Link Snap directory to /snap (enables classic support) 24 | echo "Snap will work only after loggin' out and in" 25 | 26 | echo_caption "Enabling Flatpak" 27 | install_package_arch "flatpak" 28 | 29 | echo_error "To finish the installation, this PC will reboot after confirming!!!" 30 | wait_prompt 31 | reboot 32 | } 33 | 34 | function pre_arch_setup() { 35 | echo_title "Pre Arch Setup" 36 | 37 | echo_section "Add Multilib repository to Arch" 38 | # Code from: https://stackoverflow.com/a/34516165 39 | sudo sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf 40 | 41 | echo_section "Enabling Parallel Downloads" 42 | sudo sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf 43 | 44 | echo_section "Initializing and Updating Repositories (Core, Extra, Community and Multilib)" 45 | sudo pacman-key --init 46 | sudo pacman-key --populate 47 | install_package_arch "archlinux-keyring" "sudo pacman -Syy --needed --noconfirm" 48 | 49 | echo_caption "Installing required packages for every script" 50 | # 2 Terminal Download Manager | 1 Git (If doesn't have) | 2 Compress/Extract zip files | 1 Tool to change Shell | 1 Z-Shell (ZSH) 51 | install_package_arch "curl wget git unzip zip which zsh" 52 | 53 | fix_time_zone 54 | } 55 | 56 | # TODO: Fix Secure Boot with: bootctl and sbctl 57 | # Credits: https://youtu.be/yU-SE7QX6WQ Walian - Install Secure Boot on Arch Linux (the easy way) 58 | # Tested On EndeavourOS 59 | # 60 | # 1 sbctl status 61 | # 2 sbctl create-keys 62 | # 3 sbctl enroll-keys -m 63 | # 4 sbctl -s 64 | # 5 sbctl -s -o /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed /usr/lib/systemd/boot/efi/systemd-bootx64.efi 65 | # 6 sbctl sign -s -o /usr/lib/systemd/boot/efi/systemd-bootx64.efi.signed /usr/lib/systemd/boot/efi/systemd-bootx64.efi 66 | # 7 sbctl -s /efi/EFI/systemd/systemd-bootx64.efi 67 | # 8 sbctl sign -s /efi/EFI/systemd/systemd-bootx64.efi 68 | # 9 bootctl install 69 | # 10 sbctl sign -s /efi/1f0883d502ec49c5a55e9acdd375bc4a/6.9.6-arch1-1/linux # GENERATED KERNEL DIR 70 | # 11 sbctl verify 71 | # 12 reboot 72 | # 13 sbctl status 73 | # 14 bootctl status 74 | -------------------------------------------------------------------------------- /src/lib/base-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/install-package.sh 4 | source ./src/lib/title-templates.sh 5 | 6 | SYSTEM_BASED_ON=$(grep -i "ID_LIKE=" /etc/*-release | sed -e "s/^.*ID_LIKE=//" | head -n1) 7 | SYSTEM_NAME=$( (lsb_release -ds || cat /etc/*-release || uname -om) 2>/dev/null | head -n1 | sed -e "s/\"//g") 8 | ARCH=$(uname -om | sed -e "s/\ .*//") 9 | 10 | readonly SYSTEM_BASED_ON 11 | readonly SYSTEM_NAME 12 | readonly ARCH 13 | 14 | # Initialize Global variables 15 | readonly CONFIG_FOLDER=.config/ledragox-linux-script 16 | SCRIPT_FOLDER=$(pwd) 17 | app_counter=0 18 | 19 | readonly SCRIPT_FOLDER 20 | 21 | function script_logo() { 22 | echo "<••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••>" 23 | echo '██╗ ██╗███╗ ██╗██╗ ██╗██╗ ██╗███████╗ ██████╗██████╗ ██╗██████╗ ████████╗' 24 | echo '██║ ██║████╗ ██║██║ ██║╚██╗██╔╝██╔════╝██╔════╝██╔══██╗██║██╔══██╗╚══██╔══╝' 25 | echo '██║ ██║██╔██╗ ██║██║ ██║ ╚███╔╝ ███████╗██║ ██████╔╝██║██████╔╝ ██║ ' 26 | echo '██║ ██║██║╚██╗██║██║ ██║ ██╔██╗ ╚════██║██║ ██╔══██╗██║██╔═══╝ ██║ ' 27 | echo '███████╗██║██║ ╚████║╚██████╔╝██╔╝ ██╗███████║╚██████╗██║ ██║██║██║ ██║ ' 28 | echo '╚══════╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ' 29 | echo "<••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••>" 30 | echo -n " " && echo "$SYSTEM_NAME $ARCH - Based on $SYSTEM_BASED_ON" 31 | echo_error ' Script made by LeDragoX' 32 | echo "<••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••>" 33 | } 34 | 35 | function config_environment() { 36 | cat < Powerlevel10k" 104 | sudo mkdir --parents /usr/share/fonts 105 | sudo mv --force --verbose fonts/* /usr/share/fonts 106 | fc-cache -v -f 107 | 108 | echo_caption "Removing fonts/ folder from $(pwd)" 109 | rm -rf fonts/ 110 | 111 | echo_section "Create Downloads folder" 112 | mkdir --parents ~/Downloads 113 | } 114 | 115 | function install_my_flatpak_packages() { 116 | local flatpak_apps=( 117 | "dev.vencord.Vesktop" # | Vesktop (Best discord alternative for linux) 118 | "org.onlyoffice.desktopeditors" # | ONLYOFFICE Desktop Editors 119 | # Emulators 120 | "app.xemu.xemu" # ❌ | Xbox 121 | "io.github.ryubing.Ryujinx" # ❌ | Nintendo Switch 122 | "net.kuribo64.melonDS" # ✅ | Nintendo DS 123 | "net.pcsx2.PCSX2" # ✅ | PS2 124 | "net.rpcs3.RPCS3" # ❌ | PS3 125 | "net.shadps4.shadPS4" # ✅ | PS4 126 | "org.DolphinEmu.dolphin-emu" # ❌ | Nintendo GameCube / Wii 127 | "org.duckstation.DuckStation" # ✅ | PS1 128 | "org.libretro.RetroArch" # ✅ | Most Retro 129 | "org.ppsspp.PPSSPP" # ✅ | PSP 130 | ) 131 | 132 | echo_section "Installing via flatpak" 133 | echo "${flatpak_apps[*]}" 134 | install_package_flatpak "${flatpak_apps[*]}" 135 | } 136 | 137 | function install_zsh() { 138 | echo_title "Z-Shell install" 139 | echo_caption "Zsh should already be installed, this just to finish it's install" 140 | 141 | echo_caption "Make Zsh the default shell" 142 | chsh --shell "$(which zsh)" 143 | $SHELL --version 144 | 145 | echo_caption "Needs to log out and log in to make the changes" 146 | echo "$SHELL" 147 | } 148 | 149 | function install_oh_my_zsh() { 150 | local ZSH_PLUGINS="(git zsh-autosuggestions zsh-syntax-highlighting battery asdf docker nvm node deno pip python rvm ruby)" 151 | readonly ZSH_PLUGINS 152 | 153 | echo_section "Oh My Zsh" 154 | 155 | if [[ -d "$HOME/.oh-my-zsh" ]]; then 156 | echo_error "ATTENTION - Removing ~/.oh-my-zsh file to reinstall from 0." 157 | sudo rm -rf ~/.oh-my-zsh 158 | fi 159 | 160 | echo_caption "Installing Oh My Zsh..." 161 | echo_error "TYPE 'Y', THEN 'EXIT', THE SCRIPT IS NOT FINISHED YET" 162 | sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" 163 | 164 | echo_caption "Setting Powerlevel10k theme on ZSH..." 165 | sudo sed -i 's/^ZSH_THEME="robbyrussell"/ZSH_THEME="powerlevel10k\/powerlevel10k"/' ~/.zshrc 166 | 167 | echo_section "Powerlevel10k for Oh My Zsh" 168 | git clone --depth=1 https://github.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/themes/powerlevel10k 169 | 170 | echo_caption "Updating Powerlevel10k..." 171 | git -C "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/themes/powerlevel10k pull 172 | 173 | echo_caption "Install plugins on oh-my-zsh custom plugins folder: $ZSH_PLUGINS" 174 | git clone https://github.com/zsh-users/zsh-autosuggestions.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/plugins/zsh-autosuggestions 175 | git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}"/plugins/zsh-syntax-highlighting 176 | 177 | echo_caption "Adding plugins to ~/.zshrc file..." 178 | sudo sed -i "s/^plugins=.*/plugins=$ZSH_PLUGINS/" ~/.zshrc 179 | } 180 | 181 | function wait_prompt() { 182 | read -r -p "Press ENTER to continue..." 183 | } 184 | -------------------------------------------------------------------------------- /src/lib/fedora-base-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/base-script.sh 4 | source ./src/lib/install-package.sh 5 | source ./src/lib/title-templates.sh 6 | 7 | function pre_fedora_setup() { 8 | # 2 Terminal Download Manager | 1 Git (If doesn't have) | 2 Compress/Extract zip files | 1 Tool to change Shell | 1 Z-Shell (ZSH) | 1 Install chsh commands + others 9 | install_package_fedora "curl wget git unzip zip which zsh util-linux-user" 10 | 11 | fix_time_zone 12 | } 13 | 14 | function upgrade_all_fedora() { 15 | sudo dnf upgrade 16 | install_package_fedora "dnf-plugin-system-upgrade" 17 | } 18 | -------------------------------------------------------------------------------- /src/lib/install-package.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/title-templates.sh 4 | 5 | # TODO: detect the OS package manager and do it automatically 6 | # TODO 2: Allow to use flags such as: 7 | # - Per Distro: --apt --dnf --aur (with yay) --pacman 8 | # - Globally: --snap --flatpak (--nix?) 9 | # - More options: --single-install (default) --multiple-install --add-apt-repo 10 | function install_package() { 11 | local apps=("$1") 12 | if [[ $# -eq 1 ]]; then 13 | echo_error "Package install command missing!!! Quitting..." || exit 14 | else 15 | local install_block="$2" 16 | fi 17 | 18 | echo_caption "Runnning: $install_block" 19 | echo_caption "For each package: ${apps[*]}" 20 | 21 | # Using IFS (Internal Field Separator) to manage arrays 22 | local counter=0 23 | while IFS=" " read -ra apps; do 24 | for app in "${apps[@]}"; do 25 | echo_section "($((counter += 1))/${#apps[@]}) - ${app}" 26 | eval "$install_block" "${app}" 27 | done 28 | done <<<"${apps[@]}" 29 | } 30 | 31 | function install_package_flatpak() { 32 | if [[ $# -eq 1 ]]; then 33 | install_package "$1" "flatpak install flathub --system -y" 34 | elif [[ $# -eq 2 ]]; then 35 | install_package "$1" "$2" 36 | fi 37 | } 38 | 39 | function install_package_arch() { 40 | if [[ $# -eq 1 ]]; then 41 | install_package "$1" "sudo pacman -S --needed --noconfirm" 42 | elif [[ $# -eq 2 ]]; then 43 | install_package "$1" "$2" 44 | fi 45 | } 46 | 47 | function install_package_fedora() { 48 | if [[ $# -eq 1 ]]; then 49 | install_package "$1" "sudo dnf install -y" 50 | elif [[ $# -eq 2 ]]; then 51 | install_package "$1" "$2" 52 | fi 53 | } 54 | 55 | function install_package_ubuntu() { 56 | if [[ $# -eq 1 ]]; then 57 | install_package "$1" "sudo apt install -y" 58 | elif [[ $# -eq 2 ]]; then 59 | install_package "$1" "$2" 60 | fi 61 | } 62 | -------------------------------------------------------------------------------- /src/lib/title-templates.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function echo_title() { 4 | local text="$1" 5 | echo && echo "<•••••••••••••••••••••••••••••••••••••••••••••••••••••••>" 6 | echo " $text" 7 | echo "<•••••••••••••••••••••••••••••••••••••••••••••••••••••••>" 8 | } 9 | 10 | function echo_section() { 11 | local text="$1" 12 | echo && echo "<••••••••••{ $text }••••••••••>" 13 | } 14 | 15 | function echo_caption() { 16 | local text="$1" 17 | echo "••> $1" 18 | } 19 | 20 | # Code from: https://stackoverflow.com/a/18216114 21 | function echo_error() { 22 | printf '\E[31m' 23 | echo "$@" 24 | printf '\E[0m' 25 | } 26 | -------------------------------------------------------------------------------- /src/lib/ubuntu-base-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/base-script.sh 4 | source ./src/lib/install-package.sh 5 | source ./src/lib/title-templates.sh 6 | 7 | function pre_ubuntu_setup() { 8 | echo_title "Pre Ubuntu Setup" 9 | echo_section "Fix/Update currently installed Packages" 10 | 11 | echo_caption "Fixing broken packages..." 12 | sudo apt update -y --fix-missing 13 | sudo dpkg --configure -a # Attempts to fix problems with broken dependencies between program packages. 14 | sudo apt-get --fix-broken install 15 | 16 | echo_caption "Updating repositories and removing leftovers..." 17 | sudo apt update -y 18 | sudo apt autoclean -y # cleans your local repository of all packages that APT has downloaded. 19 | sudo apt autoremove -y # removes dependencies that are no longer needed by your System. 20 | 21 | echo_caption "Installing required packages for every script..." 22 | # 2 Terminal Download Manager | 1 Git (If doesn't have) | 2 Compress/Extract zip files | 1 Tool to change Shell | 1 Z-Shell (ZSH) 23 | install_package_ubuntu "curl wget git unzip zip zsh" 24 | 25 | fix_time_zone 26 | } 27 | 28 | function upgrade_all_ubuntu() { 29 | echo_caption "Upgrading System..." 30 | 31 | sudo apt dist-upgrade -fy 32 | } 33 | -------------------------------------------------------------------------------- /src/scripts/arch-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/arch-base-script.sh 4 | source ./src/lib/install-package.sh 5 | source ./src/lib/base-script.sh 6 | 7 | function main_menu() { 8 | script_logo 9 | PS3="Select an option: " 10 | select option in "Go Back" "[REBOOT] Install Package Managers (Yay, Snap & Flatpak)" 'Auto-install from "Scratch" (DE, Packages, Boot, Drivers, Fonts + Oh My ZSH)' "[MENU] Install Desktop Environment" "Install all Arch Packages (Requires package managers)" "Setup Desktop Workflow (GPU Drivers, Pipewire Audio, Fonts + Oh My ZSH)" "Install SVP (Watch videos in 60+ FPS)"; do 11 | echo "You chose to $option" 12 | case $option in 13 | "Go Back") 14 | clear 15 | echo "Exiting..." && echo 16 | bash ./linux-script.sh 17 | break 18 | ;; 19 | "[REBOOT] Install Package Managers (Yay, Snap & Flatpak)") 20 | clear 21 | install_package_managers 22 | 23 | wait_prompt 24 | main_menu 25 | ;; 26 | 'Auto-install from "Scratch" (DE, Packages, Boot, Drivers, Fonts + Oh My ZSH)') 27 | clear 28 | install_desktop_environment 29 | install_packages_arch 30 | install_kvm 31 | install_version_managers 32 | configure_grub_bootloader 33 | configure_graphics_driver 34 | configure_audio 35 | install_fonts 36 | install_zsh 37 | install_oh_my_zsh 38 | 39 | wait_prompt 40 | main_menu 41 | ;; 42 | "[MENU] Install Desktop Environment") 43 | clear 44 | install_desktop_environment 45 | 46 | wait_prompt 47 | main_menu 48 | ;; 49 | "Install all Arch Packages (Requires package managers)") 50 | clear 51 | install_packages_arch 52 | install_kvm 53 | install_version_managers 54 | 55 | wait_prompt 56 | main_menu 57 | ;; 58 | "Setup Desktop Workflow (GPU Drivers, Pipewire Audio, Fonts + Oh My ZSH)") 59 | clear 60 | configure_graphics_driver 61 | configure_audio 62 | install_fonts 63 | install_zsh 64 | install_oh_my_zsh 65 | 66 | wait_prompt 67 | main_menu 68 | ;; 69 | "Install SVP (Watch videos in 60+ FPS)") 70 | clear 71 | install_svp 72 | 73 | wait_prompt 74 | main_menu 75 | ;; 76 | *) 77 | clear 78 | echo_error "ERROR: Invalid Option" 79 | main_menu 80 | break 81 | ;; 82 | esac 83 | break 84 | done 85 | } 86 | 87 | function install_desktop_environment() { 88 | install_package_arch "xorg" # | XOrg & XOrg Server | 89 | 90 | PS3="Select the Desktop Environment (1 to skip): " 91 | select desktop_environment in "No Desktop (skip)" "Cinnamon" "Gnome" "KDE Plasma" "XFCE"; do 92 | echo "You chose the $desktop_environment" 93 | case $desktop_environment in 94 | "No Desktop (skip)") 95 | echo_caption "Skipping..." 96 | ;; 97 | "Cinnamon") 98 | echo_section "Installing $desktop_environment" 99 | # | GDM Login Manager | Cinnamon 100 | install_package_arch "gdm cinnamon" 101 | disableSessionManagers 102 | 103 | echo_caption "Setting sudo systemctl enable gdm..." 104 | sudo systemctl enable gdm 105 | ;; 106 | "Gnome") 107 | echo_section "Installing $desktop_environment" 108 | # | GDM Login Manager | Pure Gnome | 109 | install_package_arch "gdm gnome" 110 | disableSessionManagers 111 | 112 | echo "Setting sudo systemctl enable gdm" 113 | sudo systemctl enable gdm 114 | ;; 115 | "KDE Plasma") 116 | echo_section "Installing $desktop_environment" 117 | # | SDDM Login Manager | Pure KDE Plasma | Wayland Session for KDE | KDE file manager | KDE screenshot tool 118 | install_package_arch "sddm plasma plasma-wayland-session dolphin spectacle" 119 | disableSessionManagers 120 | 121 | echo_caption "Setting sudo systemctl enable sddm..." 122 | sudo systemctl enable sddm 123 | ;; 124 | "XFCE") 125 | echo_section "Installing $desktop_environment" 126 | # | LightDM Login Manager | Login Screen Greeter (LightDM) | Pure XFCE | 127 | install_package_arch "lightdm lightdm-gtk-greeter xfce4 xfce4-goodies" 128 | disableSessionManagers 129 | 130 | echo "Setting sudo systemctl enable lightdm" 131 | sudo systemctl enable lightdm 132 | ;; 133 | *) 134 | echo_error "ERROR: Invalid Option" 135 | install_desktop_environment 136 | break 137 | ;; 138 | esac 139 | break 140 | done 141 | } 142 | 143 | function install_packages_arch() { 144 | local arch_pacman_apps=( 145 | "adobe-source-han-sans-cn-fonts adobe-source-han-sans-hk-fonts adobe-source-han-sans-jp-fonts adobe-source-han-sans-kr-fonts adobe-source-han-sans-otc-fonts adobe-source-han-sans-tw-fonts noto-fonts-emoji ttf-dejavu" # | Fonts and Emoji support 146 | # Don't remove this comment to format properly 147 | "arc-gtk-theme" # | Arc Desktop/App Theme 148 | "amd-ucode intel-ucode" # | AMD/Intel CPU Microcode 149 | "base-devel" # | Development Tools 150 | "exfatprogs" # | exFAT driver 151 | "fastfetch" # | System Specs 152 | "file-roller" # | Manage .7z files with ease 153 | "gimp" # | Gimp 154 | "gnome-keyring" # | Fix VS Code secrets 155 | "gparted" # | Gparted 156 | "htop" # | Terminal System Monitor 157 | "man-db man-pages" # | Manual utility (English) 158 | "nano vim" # | Console text editors 159 | "ntfs-3g" # | NTFS driver 160 | "obs-studio" # | OBS Studio 161 | "pavucontrol" # | Audio Controller 162 | "python-pip" # | Python Module manager 163 | "qbittorrent" # | qBittorrent 164 | "scrcpy" # | Android ScrCpy 165 | "vlc" # | VLC 166 | #"discord" # | Discord 167 | ) 168 | 169 | echo_section "Installing via Pacman" 170 | echo "${arch_pacman_apps[*]}" 171 | install_package_arch "${arch_pacman_apps[*]}" 172 | 173 | # | Microsoft Edge | Parsec | RAR/ZIP Manager GUI 174 | # | Spotify adblock | Google Chrome (Optional) 175 | local arch_aur_apps="microsoft-edge-stable-bin parsec-bin spotify-adblock-git" #google-chrome" 176 | 177 | echo_title "Installing via Yay (AUR)" 178 | install_package_arch "$arch_aur_apps" "yay -S --needed --noconfirm" 179 | 180 | # | Emote w/ shortcut 181 | local arch_snap_apps=("emote") 182 | # | VS Code (or code-insiders) 183 | local arch_snap_apps_classic="code" 184 | 185 | echo_title "Installing via Snap" 186 | install_package_arch "${arch_snap_apps[*]}" "sudo snap install" 187 | install_package_arch "$arch_snap_apps_classic" "sudo snap install --classic" 188 | 189 | install_my_flatpak_packages 190 | } 191 | 192 | function install_kvm() { 193 | install_section "Installing KVM properly :)" 194 | install_package_arch "virt-manager qemu-desktop dnsmasq iptables-nft" 195 | sudo systemctl enable --now libvirtd.service 196 | } 197 | 198 | function install_svp() { 199 | # SVP Dependencies 200 | local svp_pacman_apps="libmediainfo lsof qt5-base qt5-declarative qt5-svg vapoursynth" 201 | install_package_arch "$svp_pacman_apps" 202 | # SVP Dependency # SVP 4 Linux (AUR) # Full MPV working with SVP # HEAVY SVP Dependency 203 | local svp_aur_apps="rsound svp mpv-full spirv-cross" 204 | install_package_arch "$svp_aur_apps" "yay -S --needed --noconfirm" 205 | } 206 | 207 | function configure_audio() { 208 | echo_title "Configuring Audio w/ PipeWire" 209 | 210 | install_package_arch "lib32-pipewire pipewire pipewire-alsa pipewire-jack pipewire-pulse wireplumber" 211 | systemctl --user disable --now pulseaudio.service pulseaudio.socket 212 | systemctl --user mask --now pulseaudio.service pulseaudio.socket 213 | systemctl --user enable --now pipewire.socket pipewire-pulse.socket pipewire pipewire-session-manager 214 | pactl info 215 | } 216 | 217 | function configure_grub_bootloader() { 218 | echo_title "Configuring GRUB for multiple Systems" 219 | 220 | install_package_arch "grub-customizer os-prober" 221 | 222 | echo_caption "Help GRUB detect Windows installs..." 223 | sudo os-prober 224 | 225 | echo_caption "Enabling os-prober execution on grub-mkconfig..." 226 | sudo sh -c "echo 'GRUB_DISABLE_OS_PROBER=false' >> /etc/default/grub" 227 | 228 | echo_caption "Re-Configuring GRUB" 229 | sudo grub-mkconfig -o /boot/grub/grub.cfg 230 | 231 | echo_caption "Reloading all fonts in cache..." 232 | fc-cache -v -f 233 | } 234 | 235 | function configure_graphics_driver() { 236 | echo_title "Configuring Graphics Driver (NVIDIA only at the moment)" 237 | 238 | if (lspci -k | grep -A 2 -E "(VGA|3D)" | grep -i "NVIDIA"); then 239 | echo_section "Installing NVIDIA drivers" 240 | if (uname -r | grep -i "\-lts"); then 241 | install_package_arch nvidia-lts # NVIDIA proprietary driver for linux-lts kernel 242 | else 243 | install_package_arch nvidia # NVIDIA proprietary driver for linux kernel 244 | fi 245 | # NVIDIA utils for 32 bits | NVIDIA Settings | NVIDIA CUDA SDK / OpenCL 246 | install_package_arch "lib32-nvidia-utils nvidia-settings cuda" 247 | 248 | echo_caption "Making /etc/X11/xorg.conf ..." 249 | echo_caption "DIY: Remember to comment lines like 'LOAD: \"dri\"' ..." 250 | sudo nvidia-xconfig 251 | 252 | echo_caption "Loading nvidia settings from /etc/X11/xorg.conf ..." 253 | nvidia-settings --load-config-only 254 | else 255 | echo "Skipping graphics driver install..." 256 | fi 257 | } 258 | 259 | function disableSessionManagers() { 260 | echo_caption "Disabling all Session Managers before enabling another..." 261 | 262 | sudo systemctl disable gdm 263 | sudo systemctl disable lightdm 264 | sudo systemctl disable sddm 265 | } 266 | 267 | function main() { 268 | config_environment 269 | pre_arch_setup 270 | main_menu 271 | } 272 | 273 | main 274 | -------------------------------------------------------------------------------- /src/scripts/fedora-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/base-script.sh 4 | source ./src/lib/install-package.sh 5 | source ./src/lib/fedora-base-script.sh 6 | 7 | function main() { 8 | config_environment 9 | script_logo 10 | pre_fedora_setup 11 | add_fedora_repositories 12 | install_packages_fedora 13 | install_version_managers 14 | install_fonts 15 | install_zsh 16 | install_oh_my_zsh 17 | upgrade_all_fedora 18 | } 19 | 20 | function add_fedora_repositories() { 21 | echo_title "Adding Required Repos" 22 | 23 | sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc 24 | echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo >/dev/null 25 | 26 | sudo dnf update 27 | } 28 | 29 | function install_packages_fedora() { 30 | local fedora_dnf_apps=( 31 | "code" # | VS Code (64-Bits) 32 | "gimp" # | Gimp 33 | "obs-studio" # | OBS Studio 34 | "qbittorrent" # | qBittorrent 35 | ) 36 | 37 | echo_section "Installing via dnf" 38 | echo "${fedora_dnf_apps[*]}" 39 | install_package_fedora "${fedora_dnf_apps[*]}" 40 | install_my_flatpak_packages 41 | } 42 | 43 | main 44 | -------------------------------------------------------------------------------- /src/scripts/ubuntu-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/base-script.sh 4 | source ./src/lib/install-package.sh 5 | source ./src/lib/ubuntu-base-script.sh 6 | 7 | function add_ubuntu_repositories() { 8 | echo_title "Adding new PPAs repositories" 9 | 10 | # https://linuxhint.com/bash_loop_list_strings/ 11 | # Declare an array of string with type 12 | 13 | declare -a ADD_PPAS=( 14 | # PPA/Repo Stuff 15 | "ppa:danielrichter2007/grub-customizer" # | GRUB Customizer 16 | "ppa:obsproject/obs-studio" # | OBS Studio 17 | "ppa:pipewire-debian/pipewire-upstream" # | Pipewire 18 | "ppa:qbittorrent-team/qbittorrent-stable" # | qBittorrent 19 | ) 20 | readonly ADD_PPAS 21 | 22 | # Iterate the string array using for loop 23 | echo_section "Installing via Advanced Package Tool (apt)..." 24 | for ppa in "${ADD_PPAS[@]}"; do 25 | echo_caption "Installing: $ppa" 26 | sudo add-apt-repository -y "$ppa" 27 | done 28 | 29 | # Adding manually the rest 30 | 31 | # Google Chrome 32 | wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - 33 | sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list' 34 | 35 | ## Microsoft Edge - Setup 36 | curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >microsoft.gpg 37 | sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/ 38 | sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge.list' 39 | sudo rm microsoft.gpg 40 | 41 | # Spotify 42 | curl -sS https://download.spotify.com/debian/pubkey_7A3A762FAFD4A51F.gpg | sudo gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/spotify.gpg 43 | echo "deb http://repository.spotify.com stable non-free" | sudo tee /etc/apt/sources.list.d/spotify.list 44 | 45 | # VS Code (64-Bits) 46 | curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor >packages.microsoft.gpg 47 | sudo install -o root -g root -m 644 packages.microsoft.gpg /usr/share/keyrings/ 48 | sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list' 49 | sudo rm packages.microsoft.gpg 50 | 51 | sudo apt update -y 52 | } 53 | 54 | function install_packages_ubuntu() { 55 | echo_title "Install Apt Packages" 56 | 57 | sudo dpkg --add-architecture i386 # Enable 32-bits Architecture 58 | sudo DEBIAN_FRONTEND=noninteractive apt install -y ubuntu-restricted-extras # Remove interactivity | Useful proprietary stuff 59 | 60 | declare -a ubuntu_apps=( 61 | # Packages that i use CLI 62 | "adb fastboot scrcpy" # | Android Debugging + Android Screen Copy 63 | "arc-theme" # | My current favorite Desktop / Icon theme 64 | "build-essential" # | Building and Compiling requirement 65 | "file-roller" # | Manage .7z files with ease 66 | "gdebi gdebi-core" # | CLI/GUI .deb Installer 67 | "gparted" # | Gparted 68 | "grub-customizer grub-efi grub2-common" # | GRUB Customizer + EFI GRUB Requirements 69 | "htop vim" # | Terminal System Monitor 70 | "nano" # | Terminal Text Editor 71 | "neofetch" # | Neofetch Command 72 | "ntfs-3g" # | NTFS support 73 | "os-prober" # | Detect Windows install 74 | "pavucontrol" # | Audio Controller 75 | "pip" # | Python Module manager 76 | # Personal GUI Packages 77 | #"google-chrome-stable" # | Google Chrome 78 | "apt-transport-https code" # | VS Code (64-Bits) w/ Dependency 79 | "discord" # | Discord 80 | "gimp" # | GNU Image Manipulation Program (GIMP) 81 | "microsoft-edge-stable" # | Microsoft Edge 82 | "obs-studio" # | OBS Studio 83 | "qbittorrent" # | qBittorrent 84 | "spotify-client" # | Spotify 85 | "vlc" # | VLC 86 | ) 87 | 88 | echo_section "Installing via Advanced Package Tool (apt)..." 89 | install_package_ubuntu "${ubuntu_apps[*]}" 90 | 91 | echo "Finishing setup of incomplete installs..." 92 | 93 | sudo gpasswd -a "$USER" plugdev 94 | 95 | declare -a apps_check=( 96 | "discord" # Discord 97 | "onlyoffice-desktopeditors" # ONLY Office 98 | "parsec" # Parsec 99 | ) 100 | 101 | # If these packages are not found, this is the manual install 102 | echo_section "Installing via Advanced Package Tool (apt)..." 103 | for app in "${apps_check[@]}"; do 104 | if (apt list --installed | grep -i "$app/"); then 105 | echo "$app ALREADY INSTALLED, SKIPPING..." 106 | else 107 | echo_caption "Installing: $app" 108 | 109 | # I know, SWITCH CASE THING 110 | echo "Installing properly $app..." 111 | if [[ "$app" = "discord" ]]; then 112 | echo "$app" 113 | # Discord 114 | wget -c -O ~/"$CONFIG_FOLDER"/discord.deb "https://discordapp.com/api/download?platform=linux&format=deb" 115 | sudo gdebi -n ~/"$CONFIG_FOLDER"/discord.deb 116 | fi 117 | 118 | if [[ "$app" = "onlyoffice-desktopeditors" ]]; then 119 | echo "$app" 120 | # ONLY Office 121 | wget -c -O ~/"$CONFIG_FOLDER"/onlyoffice-desktopeditors_amd64.deb "http://download.onlyoffice.com/install/desktop/editors/linux/onlyoffice-desktopeditors_amd64.deb" 122 | sudo gdebi -n ~/"$CONFIG_FOLDER"/onlyoffice-desktopeditors_amd64.deb 123 | fi 124 | 125 | if [[ "$app" = "parsec" ]]; then 126 | echo "$app" 127 | # Parsec 128 | wget -c -O ~/"$CONFIG_FOLDER"/parsec-linux.deb "https://builds.parsecgaming.com/package/parsec-linux.deb" 129 | sudo gdebi -n ~/"$CONFIG_FOLDER"/parsec-linux.deb 130 | fi 131 | fi 132 | done 133 | } 134 | 135 | function configure_audio() { 136 | echo_title "Configuring Audio w/ PipeWire" 137 | 138 | install_package_ubuntu "pipewire pipewire-pulse pipewire-audio-client-libraries wireplumber gstreamer1.0-pipewire libspa-0.2-bluetooth libspa-0.2-jack" # | Pipewire audio server 139 | systemctl --user disable --now pulseaudio.service pulseaudio.socket 140 | systemctl --user mask --now pulseaudio.service pulseaudio.socket 141 | systemctl --user enable --now pipewire.socket pipewire-pulse.socket pipewire pipewire-session-manager 142 | pactl info 143 | } 144 | 145 | function configure_grub_bootloader() { 146 | echo_title "Prepare GRUB" 147 | 148 | sudo grub-install 149 | if (neofetch | grep -i Pop\!_OS); then 150 | sudo cp /boot/grub/x86_64-efi/grub.efi /boot/efi/EFI/pop/grubx64.efi 151 | echo "1) Click on the File tab > Change Environment... " >~/"$CONFIG_FOLDER"/grub.txt 152 | { 153 | echo "2) Where is OUTPUT_FILE: '/boot/grub/grub.cfg' Switch to: " 154 | echo "/boot/efi/EFI/pop/grub.cfg" 155 | echo "3) Then check [X] Save this setting > Apply\!" 156 | } >>~/"$CONFIG_FOLDER"/grub.txt 157 | 158 | cat ~/"$CONFIG_FOLDER"/grub.txt 159 | sudo grub-customizer 160 | else 161 | echo_caption "Not Pop\!_OS" 162 | fi 163 | 164 | clear 165 | rm ~/"$CONFIG_FOLDER"/grub.txt 166 | echo "GRUB Ready!" 167 | } 168 | 169 | function configure_graphics_driver() { 170 | # NVIDIA Graphics Driver 171 | sudo cat /etc/X11/default-display-manager 172 | if (neofetch | grep -i Pop\!_OS); then # Verify if the Distro already include the NVIDIA driver, currently Pop!_OS. 173 | echo "OS already included Drivers on ISO, but installing if it isn't" 174 | install_package_ubuntu "system76-driver-nvidia" 175 | else 176 | if (command -v nvidia-smi); then 177 | echo "NVIDIA Graphics Driver already installed...proceeding with Extras" 178 | install_package_ubuntu "ocl-icd-opencl-dev" && 179 | install_package_ubuntu "libvulkan1 libvulkan1:i386" && 180 | install_package_ubuntu "nvidia-settings" && 181 | install_package_ubuntu "dkms linux-headers-generic" 182 | else 183 | if (lspci -k | grep -i NVIDIA); then # Checking if your GPU is from NVIDIA. 184 | echo "Blacklisting NOUVEAU driver from NVIDIA in /etc/modprobe.d/blacklist.conf" 185 | sudo sh -c "echo '# Freaking open-source NVIDIA driver that glitches every system \nblacklist nouveaublacklist lbm-nouveauoptions nouveau modeset=0alias nouveau offalias lbm-nouveau off' >> /etc/modprobe.d/blacklist.conf" 186 | 187 | echo "NVIDIA Graphics Driver and Extras" 188 | sudo add-apt-repository -y ppa:graphics-drivers/ppa && 189 | sudo apt update -y && 190 | install_package_ubuntu "nvidia-driver-525" && # 01/2023 v525 = Proprietary 191 | install_package_ubuntu "ocl-icd-opencl-dev" && 192 | install_package_ubuntu "libvulkan1 libvulkan1:i386" && 193 | install_package_ubuntu "nvidia-settings" && 194 | install_package_ubuntu "dkms linux-headers-generic" 195 | else 196 | echo "GPU different from NVIDIA" 197 | fi 198 | fi 199 | fi 200 | } 201 | 202 | function main() { 203 | config_environment 204 | script_logo 205 | pre_ubuntu_setup 206 | add_ubuntu_repositories 207 | install_packages_ubuntu 208 | install_version_managers 209 | configure_audio 210 | configure_grub_bootloader 211 | configure_graphics_driver 212 | install_fonts 213 | install_zsh 214 | install_oh_my_zsh 215 | upgrade_all_ubuntu 216 | } 217 | 218 | main 219 | -------------------------------------------------------------------------------- /src/scripts/wsl-arch-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/arch-base-script.sh 4 | source ./src/lib/install-package.sh 5 | source ./src/lib/base-script.sh 6 | 7 | function main_menu() { 8 | script_logo 9 | PS3="Select an option: " 10 | select option in "Go Back" "[REBOOT] Install Package Managers (Yay, Snap)" "[WSL] ArchWSL setup Root and User" "[WSL] ArchWSL Post Configurations (Workflow)"; do 11 | echo "You chose to $option" 12 | case $option in 13 | "Go Back") 14 | clear 15 | echo "Exiting..." && echo 16 | bash ./linux-script.sh 17 | break 18 | ;; 19 | "[REBOOT] Install Package Managers (Yay, Snap)") 20 | clear 21 | install_package_managers 22 | 23 | wait_prompt 24 | main_menu 25 | ;; 26 | 27 | "[WSL] ArchWSL setup Root and User") 28 | clear 29 | arch_wsl_setup_accounts 30 | 31 | wait_prompt 32 | main_menu 33 | ;; 34 | "[WSL] ArchWSL Post Configurations (Workflow)") 35 | clear 36 | pre_arch_setup 37 | install_packages_arch_wsl 38 | install_version_managers 39 | install_package_managers 40 | install_fonts 41 | install_zsh 42 | install_oh_my_zsh 43 | 44 | wait_prompt 45 | main_menu 46 | ;; 47 | *) 48 | clear 49 | echo_error "ERROR: Invalid Option" 50 | main_menu 51 | break 52 | ;; 53 | esac 54 | break 55 | done 56 | } 57 | 58 | function arch_wsl_setup_accounts() { 59 | CURRENT_USER=$(id -u) 60 | readonly CURRENT_USER 61 | 62 | if [[ "$CURRENT_USER" -ne 0 ]]; then 63 | echo_error "Please run as root user!" 64 | exit 1 65 | fi 66 | 67 | echo_section 'New ROOT Password' 68 | passwd 'root' 69 | echo "%wheel ALL=(ALL) ALL" >/etc/sudoers.d/wheel 70 | 71 | echo_section 'New USER account' 72 | 73 | read -r -p "Input your user name: " user_name 74 | useradd -m -G wheel -s /bin/bash "$user_name" 75 | echo "Now set a password for $user_name..." 76 | passwd "$user_name" 77 | 78 | echo_error "!!! IMPORTANT (ArchWSL) !!!" 79 | echo "To set the new Default user to $user_name..." 80 | echo "Copy the follow command on the Powershell:" && echo 81 | echo "Arch.exe config --default-user $user_name" && echo 82 | echo "At the end close the terminal" 83 | } 84 | 85 | function install_packages_arch_wsl() { 86 | # Required To compilation proccesses | The parameter to ignore fakeroot is avoid an install bug on WSL | 87 | local arch_pacman_apps="base-devel gcc man-db man-pages" 88 | 89 | echo_section "Installing via Pacman" 90 | echo "${arch_pacman_apps[*]}" 91 | install_package_arch "$arch_pacman_apps" "sudo pacman -S --needed --noconfirm --ignore=fakeroot" 92 | } 93 | 94 | function main() { 95 | config_environment 96 | pre_arch_setup 97 | main_menu 98 | } 99 | 100 | main 101 | -------------------------------------------------------------------------------- /src/scripts/wsl-ubuntu-script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/base-script.sh 4 | source ./src/lib/install-package.sh 5 | source ./src/lib/ubuntu-base-script.sh 6 | 7 | function install_packages_ubuntu_wsl() { 8 | echo_title "Install Apt Packages" 9 | 10 | sudo dpkg --add-architecture i386 # Enable 32-bits Architecture 11 | sudo DEBIAN_FRONTEND=noninteractive apt install -y ubuntu-restricted-extras # Remove interactivity | Useful proprietary stuff 12 | 13 | declare -a ubuntu_apps=( 14 | # Initial Libs that i use 15 | "build-essential" # | Building and Compiling requirement 16 | "gdebi" # | CLI/GUI .deb Installer 17 | "gdebi-core" # | CLI/GUI .deb Installer 18 | "htop" # | Terminal System Monitor 19 | "nano" # | Terminal Text Editor 20 | "neofetch" # | Neofetch Command 21 | "vim" # | Terminal Text Editor 22 | ) 23 | 24 | install_package_ubuntu "${ubuntu_apps[@]}" 25 | 26 | } 27 | 28 | function main() { 29 | config_environment 30 | script_logo 31 | pre_ubuntu_setup 32 | install_packages_ubuntu_wsl 33 | install_version_managers 34 | install_fonts 35 | install_zsh 36 | install_oh_my_zsh 37 | upgrade_all_ubuntu 38 | } 39 | 40 | main 41 | -------------------------------------------------------------------------------- /src/utils/git-gpg-ssh-setup.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | source ./src/lib/base-script.sh 4 | source ./src/lib/title-templates.sh 5 | 6 | function main_menu() { 7 | PS3="Select an option: " 8 | select option in "Exit" "Create new GPG key" "Create new SSH key" "Import GPG and SSH Keys" "Check current GIT profile" "Config. GIT profile"; do 9 | echo "You chose to $option" 10 | case $option in 11 | "Exit") 12 | clear 13 | echo "Exiting..." && echo 14 | break 15 | ;; 16 | "Create new GPG Key") 17 | clear 18 | set_gpg_key 19 | wait_prompt 20 | main_menu 21 | ;; 22 | "Create new SSH Key") 23 | clear 24 | set_ssh_key 25 | wait_prompt 26 | main_menu 27 | ;; 28 | "Import GPG and SSH Keys") 29 | clear 30 | import_keys_gpg_ssh 31 | wait_prompt 32 | main_menu 33 | ;; 34 | "Check current GIT profile") 35 | clear 36 | check_git_profile 37 | wait_prompt 38 | main_menu 39 | ;; 40 | "Config. GIT profile") 41 | clear 42 | config_git_profile 43 | wait_prompt 44 | main_menu 45 | ;; 46 | *) 47 | clear 48 | echo_error "ERROR: Invalid Option" 49 | main_menu 50 | break 51 | ;; 52 | esac 53 | break 54 | done 55 | } 56 | 57 | function enable_ssh_and_gpg_agents() { 58 | echo_section "Checking if ssh-agent is running before adding keys" 59 | eval "$(ssh-agent -s)" 60 | echo 61 | } 62 | 63 | function check_git_profile() { 64 | echo_section "Check GIT Profile" 65 | echo "Requires Git before" 66 | 67 | echo "Your Git name: $(git config --global user.name)" 68 | echo "Your Git email: $(git config --global user.email)" 69 | echo "GPG Signing key: $(git config --global user.signingkey)" 70 | echo "Commit gpgsign: $(git config --global commit.gpgsign)" 71 | echo "Default Branch: $(git config --global init.defaultBranch)" 72 | echo 73 | } 74 | 75 | function config_git_profile() { 76 | echo_section "Setup Git Profile" 77 | echo "Requires Git before" 78 | 79 | read -r -p "Set new Git user name (global): " git_user_name 80 | read -r -p "Set new Git user email (global): " git_user_email 81 | read -r -p "Set new Git Default Branch (global): " default_branch 82 | 83 | # Use variables to make life easier 84 | git config --global user.name "$git_user_name" 85 | git config --global user.email "$git_user_email" 86 | git config --global init.defaultBranch "$default_branch" 87 | 88 | echo "Your Git name (global): $(git config --global user.name)" 89 | echo "Your Git email (global): $(git config --global user.email)" 90 | echo "Your Default Branch (global): $(git config --global init.defaultBranch)" 91 | echo 92 | } 93 | 94 | function set_ssh_key() { 95 | echo_section "Setting SSH Key" 96 | 97 | local SSH_PATH=~/.ssh 98 | local SSH_ENCRYPTION_TYPE=ed25519 99 | local SSH_DEFAULT_FILE_NAME="id_$SSH_ENCRYPTION_TYPE" 100 | 101 | readonly SSH_PATH 102 | readonly SSH_ENCRYPTION_TYPE 103 | readonly SSH_DEFAULT_FILE_NAME 104 | 105 | echo "Creating folder on '$SSH_PATH'" 106 | mkdir --parents "$SSH_PATH" 107 | pushd "$SSH_PATH" || exit 108 | 109 | echo "I recommend you save your passphrase somewhere, in case you don't remember." 110 | echo "Generating new SSH Key on $SSH_PATH/$SSH_DEFAULT_FILE_NAME" 111 | 112 | if [[ -f "$SSH_PATH/$SSH_DEFAULT_FILE_NAME" ]]; then 113 | echo "$SSH_PATH/$SSH_DEFAULT_FILE_NAME already exists" 114 | else 115 | echo "$SSH_PATH/$SSH_DEFAULT_FILE_NAME does not exists | Creating..." 116 | echo "Using your email from git to create a SSH Key: $(git config --global user.email)" 117 | # Generate a new ssh key, passing every parameter as variables (Make sure to config git first) 118 | ssh-keygen -t $SSH_ENCRYPTION_TYPE -C "$(git config --global user.email) SSH Signing Key" -f "$SSH_DEFAULT_FILE_NAME" 119 | fi 120 | 121 | echo "Validating files permissions" 122 | chmod 600 "$SSH_DEFAULT_FILE_NAME" 123 | 124 | echo "Adding your private keys" 125 | ssh-add "$SSH_DEFAULT_FILE_NAME" 126 | popd || exit 127 | } 128 | 129 | function set_gpg_key() { 130 | echo_section "Setting GPG Key" 131 | 132 | gpg --list-signatures # Use this instead of creating the folder, fix permissions 133 | pushd ~/.gnupg || exit 134 | echo_caption "Importing GPG keys" 135 | gpg --import ./*.gpg 136 | 137 | echo "Setting up GPG signing key" 138 | # Code adapted from: https://stackoverflow.com/a/66242583 # My key name 139 | key_id=$(gpg --list-signatures --with-colons | grep 'sig' | grep "$(git config --global user.email)" | head -n 1 | cut -d':' -f5) 140 | git config --global user.signingkey "$key_id" 141 | echo "Setting up Commit GPG signing to true" 142 | # Always commit with GPG signature 143 | git config --global commit.gpgsign true 144 | popd || exit 145 | } 146 | 147 | function import_keys_gpg_ssh() { 148 | echo "TIP: Go to the folder using a terminal and type 'pwd', use the output to paste on the request below" 149 | read -r -p "Select the existing GPG keys folder (accepts only .gpg file format): " folder 150 | 151 | echo_caption "Importing GPG keys from: $folder" 152 | pushd "$folder" || exit 153 | gpg --import "$folder"/*.gpg 154 | 155 | # Get the exact key ID from the system 156 | # Code adapted from: https://stackoverflow.com/a/66242583 157 | gpg --list-signatures --with-colons | grep 'sig' 158 | 159 | echo_caption "From those keys, select an e-mail address" 160 | read -r -p "To select one of the keys, type a valid e-mail: " identifier 161 | 162 | key_id=$(gpg --list-signatures --with-colons | grep 'sig' | grep "$identifier" | head -n 1 | cut -d':' -f5) 163 | echo_error "Using key: $key_id" 164 | git config --global user.signingkey "$key_id" 165 | # Always commit with GPG signature 166 | git config --global commit.gpgsign true 167 | popd || exit 168 | 169 | echo 170 | echo "TIP: Go to the folder using a terminal and type 'pwd', use the output to paste on the request below" 171 | read -r -p "Select the existing SSH keys folder (accepts any file format): " folder 172 | 173 | echo_caption "Importing SSH keys from: $folder" 174 | pushd "$folder" || exit 175 | 176 | echo "Validating files permissions" 177 | chmod 600 "$folder"/* 178 | 179 | echo "Adding your private keys" 180 | ssh-add "$folder"/* 181 | popd || exit 182 | } 183 | 184 | function main() { 185 | enable_ssh_and_gpg_agents 186 | config_git_profile 187 | main_menu 188 | } 189 | 190 | main 191 | --------------------------------------------------------------------------------