This script sets up a command line environment with Zsh, Oh My Zsh, Powerlevel10k theme, fnm (Fast Node Manager), and Node.js. It also installs some useful plugins and tools.
- The script must be run as root.
- The system should have one of the following package managers:
apt-get,dnf, oryum.
wget -qO- https://raw.githubusercontent.com/grunghi/init/main/init.sh | sudo bash- Checks for Root Privileges: Ensures the script is run as root.
- Installs Required Packages: Installs
zsh,curl, andgitusing the available package manager. - Installs Oh My Zsh: Sets up Oh My Zsh for the current user.
- Installs Powerlevel10k Theme: Clones the Powerlevel10k theme into the Oh My Zsh custom themes directory.
- Installs fnm: Installs Fast Node Manager.
- Creates Custom
.zshrc: Generates a custom.zshrcfile with predefined settings and aliases. - Changes Default Shell to Zsh: Changes the default shell to Zsh for the actual user.
- Installs Node.js: Installs the latest LTS version of Node.js using fnm.
- Enables Corepack: Enables Corepack for managing Node.js package managers.
- Installs @antfu/ni: Installs the
@antfu/nipackage globally.
After the script completes, follow these steps:
- Log out and log back in to start using Zsh.
- Run
p10k configureto set up the Powerlevel10k theme. - Verify the Node.js installation with
node --version. - Verify the
niinstallation withni --version.
The script sets up the following aliases and functions in the .zshrc file:
-
Aliases:
d:nr devr:nrb:nr build --forcemg:nr migratemgc:nr migrate:createsd:nr seed
-
Functions:
mkcd(): Creates a directory and changes into it.
This project is licensed under the MIT License.