install_main_packages


"/home/yossef/notes/git/scripts/install_main_packages.md"

path: git/scripts/install_main_packages.md

- **fileName**: install_main_packages
- **Created on**: 2025-03-26 14:54:33

install main packages that i use in my system

#!/usr/bin/env bash

RC='\e[0m'
RED='\e[31m'
YELLOW='\e[33m'
GREEN='\e[32m'

: << 'END'
    - some useful tips for you
    - first remove nvim if package manager apt downlaod nvim 0.6 ;(
END

## main package arch for install ##
array_packages=(
    "zsh" "git" "neovim" "tmux" "alacritty" "picom" "vim" "nemo" "feh" "unclutter" \
    "xrandr" "zip" "ripgrep" "xclip" "fastfetch"  "fzf" "unzip" "stow"
    "nodejs" "go" "gcc" # lang
    "cargo" #rust
    "xorg" "xorg-xev" "xorg-xinit" "xbindkeys" "xorg-setxkbmap" "sxhkd" # keybind
    "iwd" "NetworkManager" "dhcpcd" "nmcli" # network
    "pavucontrol" "brightnessctl" "alsa-tools"  # audio and screen bright
    "wget" "syncthing" # apps and some packages "terminus-font" # tty main font "xdg-desktop-portal" # for download from qutebrowser "yt-dlp" # for download too and watch 
)

# creating .config for save the config for packages
mkdir -p ~/.config

# Function to install packages
install_packages() {
    # creating a forloop for all packages that i must use
    for element in "${array_packages[@]}"; do
        if _commend_exists "$element"; then
            echo -e "${GREEN}-- $element is already installed --${RC}"
            continue
        else
            echo -e "${GREEN}-- installing $element --${RC}"
            #sudo pacman -S --noconfirm "${element}"
            cpkm ${element}
            if [[ $? == 0 ]]; then
                echo -e "${GREEN}-- $element installed successfully --${RC}"
            else
                echo -e "${RED}** Error occurred while installing $element **${RC}"
            fi
        fi
    done
}

install_packages

references