Setting up a fresh Manjaro Linux environment can be streamlined with a comprehensive Bash script that automates essential configurations and installations.
Before running the initialization script, switch the default shell to Bash for compatibility
chsh -s /bin/bash
📥 Run the Script
Execute all steps with a single command:
bash -c "$(wget -qLO - https://kingtam.win/usr/uploads/script/manjaro_int.sh)"
🔧 Script Overview
The script provides a menu-driven interface with ten options, each automating a specific setup task. It loops until exit is selected, allowing multiple configurations in one session.
📋 Menu Options
- Configure Manjaro Mirrors
- Install Essential Packages
- Configure Passwordless Sudo
- Enable Tab Completion
- Retrieve Public SSH Key from GitHub
- Install VIM-PLUG
- Configure tmux
- Install Fcitx5 Input Method
- Install Google Chrome
- Install Docker
🧩 Breakdown the Script
1. Configure Manjaro Mirrors
sudo pacman-mirrors --fasttrack 20 && sudo pacman -Syyu --noconfirm
- Optimizes mirror selection for faster downloads.
- Updates the package database and system.
2. Install Essential Packages
sudo pacman -Syu --noconfirm git wget curl tree iperf3 vim tmux
- Installs commonly used tools for development and system diagnostics.
3. Configure Passwordless Sudo
current_user=$(whoami)
echo "$current_user ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/"$current_user"
sudo chmod 440 /etc/sudoers.d/"$current_user"
- Grants the current user permission to run
sudo
commands without entering a password.
4. Enable Tab Completion
echo "set completion-ignore-case on" >> ~/.inputrc
- Improves shell usability by allowing case-insensitive tab completion.
5. Retrieve Public SSH Key from GitHub
bash <(curl -fsSL git.io/key.sh) -g sillydanny
- Downloads and installs a public SSH key for GitHub access.
6. Install VIM-PLUG and Configure Vim
curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
- Installs
vim-plug
, a plugin manager for Vim. - Adds a set of useful plugins and configurations to
.vimrc
.
7. Configure tmux
cat << 'EOF' > ~/.tmux.conf
set -g mouse on
set-option -g status-position top
set -g status-bg colour235
set -g status-fg white
set -g status-left-length 50
set -g status-right-length 50
bind r source-file ~/.tmux.conf \; display "Reloaded ~/.tmux.conf"
set -g base-index 1
setw -g pane-base-index 1
setw -g mode-keys vi
bind-key h select-pane -L
bind-key j select-pane -D
bind-key k select-pane -U
bind-key l select-pane -R
bind-key -r H resize-pane -L 5
bind-key -r J resize-pane -D 5
bind-key -r K resize-pane -U 5
bind-key -r L resize-pane -R 5
set-option -g renumber-windows on
set -g history-limit 10000
set -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
EOF
- Sets up
tmux
with custom keybindings, mouse support, and visual enhancements.
8. Install Fcitx5 Input Method
sudo pacman -S --noconfirm fcitx5-im fcitx5-configtool fcitx5-chinese-addons manjaro-asian-input-support-fcitx5 fcitx5-table-extra
- Installs Fcitx5 and related packages for multilingual input, including Chinese.
9. Install Google Chrome
pamac build google-chrome
- Builds and installs Google Chrome from the AUR using
pamac
.
10. Install Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
- Installs Docker using the official convenience script for containerized development.
📦 Conclusion
Manjaro setup just got a turbo boost. No more typing the same commands like a robot every time a fresh install happens.