Darkkal44 / Cozytile

A Cozy rice ❃
476 stars 29 forks source link

Enhanced the installation script #2

Closed Marin-Kitagawa closed 1 year ago

Marin-Kitagawa commented 1 year ago
  1. This script must not be run as root. Elevated permissions are applied wherever necessary (for e.g. installing packages). Running as root will default to the .config folder of root
  2. Checking and notifying the user if some of the packages (not all of them) are already installed. Also added the --needed option so as to prevent reinstallation of the same packages again
  3. The script checks if any AUR helper (for now checks only for yay and paru) is already installed. It chooses the AUR helper already installed. If both are installed, it chooses paru
  4. If the user is installing an additional session, then sddm is not necessary to be installed because the user already has another session installed and hence the user must already have one of the following: sddm, lightdm, gdm, ly. I have considered only the first two for now. Feel free to add the rest later
  5. It checks the current shell of the $USER and if is not zsh, it changes it to zsh. If Oh My ZSH is already installed, there is a high probability of the user's default shell being zsh. There may be a human error which could have prevented this. So, adding this just in case.
  6. Also, we are checking for the previous installation of Oh My ZSH. If it is already installed, then, update it, else, install the latest version
  7. It checks if some plugins are already installed for Oh My ZSH. If yes, then leave it, else, install them. Since Oh My ZSH is already installed, and since plugins becomes a variable because .zshrc contains it as an array, ${plugins[*]} becomes valid and hence we can query all the available plugins installed by omz
  8. Also, backup the old config file before recursively copying the new config files
  9. Finally, enable sddm. Since the script only installs sddm when nothing else of its kind is installed, this means that sddm is the only one present. So, enable it. If it is already enabled (i.e. user already has sddm as the default session manager) no problem
Darkkal44 commented 1 year ago

Thank you so much for your pull request on my dotfiles repo! I really appreciate you taking the time to help me out.

I just wanted to let you know that I had already thought about some of the stuff you mentioned in your pull request, but I had accidentally pushed an old script that I messed up pretty badly.

Most of your suggestions are really good, and I'm definitely going to fix up my current script to make it work better. As for the 4th suggestion about forcing sddm, I wanted to let you know that I actually rice sddm lockscreen and I'll probably be adding it to my dotfiles soon. Plus, this script is mostly for newly installed Arch systems.

I also wanted to clarify that the backup step in the script will "move" current dotfiles to where the script will make changes instead of copying them. This should prevent any issues with installing .oh-my-zsh.

Based on your suggestions, I'll definitely be adding "if-else" statements, echo comments, and a backup step to make sure users are aware of what the script is doing. Thanks again for all your suggestions - they mean a lot to me!