Compare commits

...

2 Commits

Author SHA1 Message Date
eshanized
c1a7e13c31 🚀 feat: ad pacman fallback
Some checks are pending
Check Conventional Commit / check-commit-message (push) Waiting to run
2025-01-12 19:36:41 +05:30
eshanized
c4c61659ec ️ perf: add new alises 2025-01-12 17:15:06 +05:30
2 changed files with 32 additions and 0 deletions

32
.bashrc
View File

@@ -32,8 +32,10 @@ alias ls='ls -l --color=auto' # List directory contents in long format with col
alias grep='grep --color=auto' # Enable colorized output for grep command
alias rs="sudo pacman -Rs" # Remove packages with dependencies using pacman
alias s="sudo pacman -S" # Install packages with pacman
alias rns="sudo pacman -Rns" # Remove package with pacman
alias sy="sudo pacman -Syy" # Sync package databases and update package list
alias syyu="sudo pacman -Syyu" # Sync package databases and update system packages
alias qq="sudo pacman -Qq" # Show a list of installed package
alias lck="sudo rm /var/lib/pacman/db.lck" # Remove pacman lock file (use with caution)
alias vm="sudo systemctl enable --now vmtoolsd.service" # Enable VMware Tools service at boot
alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl" # Display recently installed packages sorted by install date (last 200)
@@ -335,3 +337,33 @@ alias ansible-play="ansible-playbook" # Run an
alias terraform-init="terraform init" # Initialize Terraform project
alias terraform-apply="terraform apply" # Apply Terraform configuration to provision resources
alias terraform-plan="terraform plan" # Preview changes Terraform will make to infrastructure
# Function to install packages with pacman and fallback to yay
install_package() {
local package_name="$1" # The name of the package to install
if [[ -z "$package_name" ]]; then
echo "Usage: install_package <package_name>"
return 1
fi
echo "Attempting to install '$package_name' with pacman..."
sudo pacman -S --noconfirm "$package_name"
if [[ $? -eq 0 ]]; then
echo "'$package_name' installed successfully with pacman!"
return 0
fi
echo "Package '$package_name' could not be installed with pacman. Trying yay..."
yay -S --noconfirm "$package_name"
if [[ $? -eq 0 ]]; then
echo "'$package_name' installed successfully with yay!"
return 0
fi
echo "Failed to install '$package_name' with both pacman and yay."
return 1
}
# Alias for convenience
alias syay="install_package"

0
config.sh Normal file → Executable file
View File