diff --git a/0-preinstall.sh b/0-preinstall.sh index a4afd5a..e77959d 100755 --- a/0-preinstall.sh +++ b/0-preinstall.sh @@ -25,10 +25,10 @@ Setting up mirrors for optimal download source setup.conf iso=$(curl -4 ifconfig.co/country-iso) timedatectl set-ntp true -pacman -S --noconfirm pacman-contrib terminus-font +pacman -S --noconfirm --needed pacman-contrib terminus-font setfont ter-v22b sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf -pacman -S --noconfirm reflector rsync grub +pacman -S --noconfirm --needed reflector rsync grub cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup echo -ne " ------------------------------------------------------------------------- @@ -42,7 +42,7 @@ echo -ne " Installing Prerequisites ------------------------------------------------------------------------- " -pacman -S --noconfirm gptfdisk btrfs-progs +pacman -S --noconfirm --needed gptfdisk btrfs-progs echo -ne " ------------------------------------------------------------------------- Formating Disk diff --git a/1-setup.sh b/1-setup.sh index 3e56479..db817dd 100755 --- a/1-setup.sh +++ b/1-setup.sh @@ -18,15 +18,15 @@ echo -ne " Network Setup ------------------------------------------------------------------------- " -pacman -S networkmanager dhclient --noconfirm --needed +pacman -S --noconfirm --needed networkmanager dhclient systemctl enable --now NetworkManager echo -ne " ------------------------------------------------------------------------- Setting up mirrors for optimal download ------------------------------------------------------------------------- " -pacman -S --noconfirm pacman-contrib curl -pacman -S --noconfirm reflector rsync grub arch-install-scripts +pacman -S --noconfirm --needed pacman-contrib curl +pacman -S --noconfirm --needed reflector rsync grub arch-install-scripts git cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak nc=$(grep -c ^processor /proc/cpuinfo) @@ -64,18 +64,26 @@ sed -i 's/^#ParallelDownloads/ParallelDownloads/' /etc/pacman.conf #Enable multilib sed -i "/\[multilib\]/,/Include/"'s/^#//' /etc/pacman.conf -pacman -Sy --noconfirm +pacman -Sy --noconfirm --needed echo -ne " ------------------------------------------------------------------------- Installing Base System ------------------------------------------------------------------------- " -cat /root/ArchTitus/pkg-files/pacman-pkgs.txt | while read line -do +# sed $INSTALL_TYPE is using install type to check for MINIMAL installation, if it's true, stop +# stop the script and move on, not installing any more packages below that line +if [[ ! $DESKTOP_ENV == server ]]; then + sed -n '/'$INSTALL_TYPE'/q;p' /root/ArchTitus/pkg-files/pacman-pkgs.txt | while read line + do + if [[ ${line} == '--END OF MINIMAL INSTALL--' ]]; then + # If selected installation type is FULL, skip the --END OF THE MINIMAL INSTALLATION-- line + continue + fi echo "INSTALLING: ${line}" - sudo pacman -S --noconfirm --needed ${line} -done + sudo pacman -S --noconfirm --needed ${line} + done +fi echo -ne " ------------------------------------------------------------------------- Installing Microcode @@ -85,11 +93,11 @@ echo -ne " proc_type=$(lscpu) if grep -E "GenuineIntel" <<< ${proc_type}; then echo "Installing Intel microcode" - pacman -S --noconfirm intel-ucode + pacman -S --noconfirm --needed intel-ucode proc_ucode=intel-ucode.img elif grep -E "AuthenticAMD" <<< ${proc_type}; then echo "Installing AMD microcode" - pacman -S --noconfirm amd-ucode + pacman -S --noconfirm --needed amd-ucode proc_ucode=amd-ucode.img fi @@ -101,14 +109,14 @@ echo -ne " # Graphics Drivers find and install gpu_type=$(lspci) if grep -E "NVIDIA|GeForce" <<< ${gpu_type}; then - pacman -S nvidia --noconfirm --needed + pacman -S --noconfirm --needed nvidia nvidia-xconfig elif lspci | grep 'VGA' | grep -E "Radeon|AMD"; then - pacman -S xf86-video-amdgpu --noconfirm --needed + pacman -S --noconfirm --needed xf86-video-amdgpu elif grep -E "Integrated Graphics Controller" <<< ${gpu_type}; then - pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa --needed --noconfirm + pacman -S --noconfirm --needed libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa elif grep -E "Intel Corporation UHD" <<< ${gpu_type}; then - pacman -S libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa --needed --noconfirm + pacman -S --needed --noconfirm libva-intel-driver libvdpau-va-gl lib32-vulkan-intel vulkan-intel libva-intel-driver libva-utils lib32-mesa fi #SETUP IS WRONG THIS IS RUN if ! source /root/ArchTitus/setup.conf; then diff --git a/2-user.sh b/2-user.sh index 27dba51..a9ddc0e 100755 --- a/2-user.sh +++ b/2-user.sh @@ -17,24 +17,58 @@ Installing AUR Softwares # You can solve users running this script as root with this and then doing the same for the next for statement. However I will leave this up to you. source $HOME/ArchTitus/setup.conf -cd ~ -git clone "https://aur.archlinux.org/yay.git" -cd ~/yay -makepkg -si --noconfirm -cd ~ -touch "~/.cache/zshhistory" -git clone "https://github.com/ChrisTitusTech/zsh" -git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k -ln -s "~/zsh/.zshrc" ~/.zshrc + cd ~ + touch "~/.cache/zshhistory" + git clone "https://github.com/ChrisTitusTech/zsh" + git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k + ln -s "~/zsh/.zshrc" ~/.zshrc -yay -S --noconfirm --needed - < ~/ArchTitus/pkg-files/aur-pkgs.txt +sed -n '/'$INSTALL_TYPE'/q;p' ~/ArchTitus/pkg-files/${DESKTOP_ENV}.txt | while read line +do + if [[ ${line} == '--END OF MINIMAL INSTALL--' ]] + then + # If selected installation type is FULL, skip the --END OF THE MINIMAL INSTALLATION-- line + continue + fi + echo "INSTALLING: ${line}" + sudo pacman -S --noconfirm --needed ${line} +done + + +if [[ ! $AUR_HELPER == none ]]; then + cd ~ + git clone "https://aur.archlinux.org/$AUR_HELPER.git" + cd ~/$AUR_HELPER + makepkg -si --noconfirm + # sed $INSTALL_TYPE is using install type to check for MINIMAL installation, if it's true, stop + # stop the script and move on, not installing any more packages below that line + sed -n '/'$INSTALL_TYPE'/q;p' ~/ArchTitus/pkg-files/aur-pkgs.txt | while read line + do + if [[ ${line} == '--END OF MINIMAL INSTALL--' ]]; then + # If selected installation type is FULL, skip the --END OF THE MINIMAL INSTALLATION-- line + continue + fi + echo "INSTALLING: ${line}" + $AUR_HELPER -S --noconfirm --needed ${line} + done +fi export PATH=$PATH:~/.local/bin -cp -r ~/ArchTitus/dotfiles/* ~/.config/ -pip install konsave -konsave -i ~/ArchTitus/kde.knsv -sleep 1 -konsave -a kde + +# Theming DE if user chose FULL installation +if [[ $INSTALL_TYPE == "FULL" ]]; then + if [[ $DESKTOP_ENV == "kde" ]]; then + cp -r ~/ArchTitus/dotfiles/* ~/.config/ + pip install konsave + konsave -i ~/ArchTitus/kde.knsv + sleep 1 + konsave -a kde + elif [[ $DESKTOP_ENV == "openbox" ]]; then + cd ~ + git clone https://github.com/stojshic/dotfiles-openbox + ./dotfiles-openbox/install-titus.sh + fi +fi echo -ne " ------------------------------------------------------------------------- diff --git a/3-post-setup.sh b/3-post-setup.sh index 1fecd6c..9d99e23 100755 --- a/3-post-setup.sh +++ b/3-post-setup.sh @@ -16,7 +16,7 @@ Final Setup and Configurations GRUB EFI Bootloader Install & Check " source /root/ArchTitus/setup.conf -genfstab -U /mnt >> /mnt/etc/fstab +genfstab -U -p / >> /etc/fstab if [[ -d "/sys/firmware/efi" ]]; then grub-install --efi-directory=/boot ${DISK} fi @@ -44,19 +44,37 @@ echo -e "All set!" echo -ne " ------------------------------------------------------------------------- - Enabling Login Display Manager + Enabling (and Theming) Login Display Manager ------------------------------------------------------------------------- " -systemctl enable sddm.service -echo -ne " -------------------------------------------------------------------------- - Setting up SDDM Theme -------------------------------------------------------------------------- -" -cat < /etc/sddm.conf -[Theme] -Current=Nordic -EOF +if [[ ${DESKTOP_ENV} == "kde" ]]; then + systemctl enable sddm.service + if [[ ${INSTALL_TYPE} == "FULL" ]]; then + echo [Theme] >> /etc/sddm.conf + echo Current=Nordic >> /etc/sddm.conf + fi + +elif [[ "${DESKTOP_ENV}" == "gnome" ]]; then + systemctl enable gdm.service + +elif [[ "${DESKTOP_ENV}" == "lxde" ]]; then + systemctl enable lxdm.service + +elif [[ "${DESKTOP_ENV}" == "openbox" ]]; then + systemctl enable lightdm.service + if [[ "${INSTALL_TYPE}" == "FULL" ]]; then + # Set default lightdm-webkit2-greeter theme to Litarvan + sed -i 's/^webkit_theme\s*=\s*\(.*\)/webkit_theme = litarvan #\1/g' /etc/lightdm/lightdm-webkit2-greeter.conf + # Set default lightdm greeter to lightdm-webkit2-greeter + sed -i 's/#greeter-session=example.*/greeter-session=lightdm-webkit2-greeter/g' /etc/lightdm/lightdm.conf + fi + +else + if [[ ! "${DESKTOP_ENV}" == "server" ]]; then + sudo pacman -S --noconfirm --needed lightdm lightdm-gtk-greeter + systemctl enable lightdm.service + fi +fi echo -ne " ------------------------------------------------------------------------- @@ -72,7 +90,7 @@ systemctl enable NetworkManager.service systemctl enable bluetooth echo -ne " ------------------------------------------------------------------------- - Cleaning + Cleaning ------------------------------------------------------------------------- " # Remove no password sudo rights diff --git a/archtitus.sh b/archtitus.sh index e18bdd6..efd3d28 100755 --- a/archtitus.sh +++ b/archtitus.sh @@ -19,7 +19,9 @@ echo -ne " source $SCRIPT_DIR/setup.conf ( bash 0-preinstall.sh )|& tee 0-preinstall.log ( arch-chroot /mnt /root/ArchTitus/1-setup.sh )|& tee 1-setup.log - ( arch-chroot /mnt /usr/bin/runuser -u $USERNAME -- /home/$USERNAME/ArchTitus/2-user.sh )|& tee 2-user.log + if [[ ! $DESKTOP_ENV == server ]]; then + ( arch-chroot /mnt /usr/bin/runuser -u $USERNAME -- /home/$USERNAME/ArchTitus/2-user.sh )|& tee 2-user.log + fi ( arch-chroot /mnt /root/ArchTitus/3-post-setup.sh )|& tee 3-post-setup.log echo -ne " @@ -34,4 +36,4 @@ echo -ne " Automated Arch Linux Installer ------------------------------------------------------------------------- Done - Please Eject Install Media and Reboot -" \ No newline at end of file +" diff --git a/pkg-files/aur-pkgs.txt b/pkg-files/aur-pkgs.txt index 8179d7a..c66c1be 100644 --- a/pkg-files/aur-pkgs.txt +++ b/pkg-files/aur-pkgs.txt @@ -1,5 +1,5 @@ +--END OF MINIMAL INSTALL-- autojump -awesome-terminal-fonts brave-bin dxvk-bin github-desktop-bin @@ -12,15 +12,8 @@ nordic-darker-standard-buttons-theme nordic-darker-theme nordic-kde-git nordic-theme -noto-fonts-emoji -papirus-icon-theme -plasma-pa ocs-url sddm-nordic-theme-git snapper-gui-git -ttf-droid -ttf-hack ttf-meslo -ttf-roboto zoom -snap-pac \ No newline at end of file diff --git a/pkg-files/budgie.txt b/pkg-files/budgie.txt new file mode 100644 index 0000000..ab7873d --- /dev/null +++ b/pkg-files/budgie.txt @@ -0,0 +1,3 @@ +budgie-desktop +gnome +--END OF MINIMAL INSTALL-- diff --git a/pkg-files/cinnamon.txt b/pkg-files/cinnamon.txt new file mode 100644 index 0000000..7fa604f --- /dev/null +++ b/pkg-files/cinnamon.txt @@ -0,0 +1,4 @@ +cinnamon +metacity +gnome-shell +--END OF MINIMAL INSTALL-- diff --git a/pkg-files/deepin.txt b/pkg-files/deepin.txt new file mode 100644 index 0000000..9c01f73 --- /dev/null +++ b/pkg-files/deepin.txt @@ -0,0 +1,3 @@ +deepin +deepin-extra +--END OF MINIMAL INSTALL-- diff --git a/pkg-files/gnome.txt b/pkg-files/gnome.txt new file mode 100644 index 0000000..24ca95a --- /dev/null +++ b/pkg-files/gnome.txt @@ -0,0 +1,3 @@ +gnome +--END OF MINIMAL INSTALL-- +gnome-extras diff --git a/pkg-files/kde.txt b/pkg-files/kde.txt new file mode 100644 index 0000000..d876134 --- /dev/null +++ b/pkg-files/kde.txt @@ -0,0 +1,34 @@ +plasma-desktop +sddm +dolphin +--END OF MINIMAL INSTALL-- +ark +audiocd-kio +bluedevil +breeze +breeze-gtk +discover +extra-cmake-modules +filelight +gwenview +kate +kde-gtk-config +kcodecs +kcoreaddons +kdeplasma-addons +kinfocenter +konsole +kscreen +kvantum-qt5 +layer-shell-qt +milou +okular +oxygen +plasma-nm +plasma-pa +powerdevil +print-manager +spectacle +systemsettings +xdg-desktop-portal-kde +zeroconf-ioslave diff --git a/pkg-files/lxde.txt b/pkg-files/lxde.txt new file mode 100644 index 0000000..c39843f --- /dev/null +++ b/pkg-files/lxde.txt @@ -0,0 +1,2 @@ +lxde +--END OF MINIMAL INSTALL-- diff --git a/pkg-files/mate.txt b/pkg-files/mate.txt new file mode 100644 index 0000000..736ee37 --- /dev/null +++ b/pkg-files/mate.txt @@ -0,0 +1,3 @@ +mate +mate-extra +--END OF MINIMAL INSTALL-- diff --git a/pkg-files/openbox.txt b/pkg-files/openbox.txt new file mode 100644 index 0000000..34ea690 --- /dev/null +++ b/pkg-files/openbox.txt @@ -0,0 +1,45 @@ +openbox +lightdm +lightdm-gtk-greeter +thunar +lxsession +rxvt-unicode +--END OF MINIMAL INSTALL-- +alsa-utils +pulseaudio +pulseaudio-alsa +wireless_tools +zsh +dunst +tint2 +rofi +feh +lightdm-webkit2-greeter +lightdm-webkit-theme-litarvan +lxappearance +qt5ct +gsimplecal +xautolock +xclip +scrot +thunar-archive-plugin +thunar-volman +thunar-media-tags-plugin +tumbler +jq +w3m +geany +nano +viewnior +pavucontrol +parcellite +neofetch +htop +picom +gtk2-perl +xfce4-power-manager +imagemagick +playerctl +xsettingsd +obconf + diff --git a/pkg-files/pacman-pkgs.txt b/pkg-files/pacman-pkgs.txt index 42bf817..8634b6a 100644 --- a/pkg-files/pacman-pkgs.txt +++ b/pkg-files/pacman-pkgs.txt @@ -6,24 +6,25 @@ xorg-drivers xorg-xkill xorg-xinit xterm -plasma-desktop +binutils +dosfstools +iptables-nft +linux-headers +noto-fonts-emoji +usbutils +xdg-user-dirs +--END OF MINIMAL INSTALL-- alsa-plugins alsa-utils -ark -audiocd-kio autoconf automake -base +awesome-terminal-fonts bash-completion bind -binutils bison -bluedevil bluez bluez-libs bluez-utils -breeze -breeze-gtk bridge-utils btrfs-progs celluloid @@ -32,15 +33,10 @@ code cronie cups dialog -discover -dolphin -dosfstools dtc efibootmgr egl-wayland exfat-utils -extra-cmake-modules -filelight flex fuse2 fuse3 @@ -48,62 +44,35 @@ fuseiso gamemode gcc gimp -git gparted gptfdisk -grub grub-customizer gst-libav gst-plugins-good gst-plugins-ugly -gwenview haveged htop -iptables-nft jdk-openjdk -kate -kcodecs -kcoreaddons -kde-plasma-addons -kinfocenter -kscreen -kvantum-qt5 -kde-gtk-config kitty -konsole -kscreen -layer-shell-qt libdvdcss -libnewt libtool -linux -linux-firmware -linux-headers lsof lutris lzop m4 make -milou -nano neofetch -networkmanager ntfs-3g ntp -okular openbsd-netcat openssh os-prober -oxygen p7zip -pacman-contrib +papirus-icon-theme patch picom pkgconf -plasma-nm -powerdevil powerline-fonts -print-manager pulseaudio pulseaudio-alsa pulseaudio-bluetooth @@ -112,34 +81,26 @@ python-psutil python-pyqt5 python-pip qemu -rsync -sddm -sddm-kcm +snap-pack snapper -spectacle steam -sudo swtpm synergy -systemsettings terminus-font traceroute +ttf-droid +ttf-hack +ttf-roboto ufw unrar unzip -usbutils -vim virt-manager virt-viewer -wget which wine-gecko wine-mono winetricks -xdg-desktop-portal-kde -xdg-user-dirs -zeroconf-ioslave zip zsh zsh-syntax-highlighting -zsh-autosuggestions \ No newline at end of file +zsh-autosuggestions diff --git a/pkg-files/xfce.txt b/pkg-files/xfce.txt new file mode 100644 index 0000000..953826a --- /dev/null +++ b/pkg-files/xfce.txt @@ -0,0 +1,3 @@ +xfce4 +xfce-goodies +--END OF MINIMAL INSTALL-- diff --git a/startup.sh b/startup.sh index 5ea082d..7f76044 100755 --- a/startup.sh +++ b/startup.sh @@ -269,6 +269,35 @@ done read -rep "Please enter your hostname: " nameofmachine set_option NAME_OF_MACHINE $nameofmachine } + +aurhelper () { + # Let the user choose AUR helper from predefined list + echo -ne "Please enter your desired AUR helper:\n" + options=(paru yay picaur aura trizen pacaur none) + select_option $? 4 "${options[@]}" + aur_helper=${options[$?]} + set_option AUR_HELPER $aur_helper +} + +desktopenv () { + # Let the user choose Desktop Enviroment from predefined list + echo -ne "Please select your desired Desktop Enviroment:\n" + options=(gnome kde cinnamon xfce mate budgie lxde deepin openbox server) + select_option $? 4 "${options[@]}" + desktop_env=${options[$?]} + set_option DESKTOP_ENV $desktop_env +} + +installtype () { + echo -ne "Please select type of installation:\n\n + Full install: Installs full featured desktop enviroment, with added apps and themes needed for everyday use\n + Minimal Install: Installs only apps few selected apps to get you started\n" + options=(FULL MINIMAL) + select_option $? 4 "${options[@]}" + install_type=${options[$?]} + set_option INSTALL_TYPE $install_type +} + # More features in future # language (){} @@ -278,6 +307,20 @@ logo userinfo clear logo +desktopenv +# Set fixed options that installation uses if user choses server installation +set_option INSTALL_TYPE MINIMAL +set_option AUR_HELPER NONE +if [[ ! $desktop_env == server ]]; then + clear + logo + aurhelper + clear + logo + installtype +fi +clear +logo diskpart clear logo @@ -287,4 +330,4 @@ logo timezone clear logo -keymap \ No newline at end of file +keymap