Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2024
894
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 1 0
  1. # Define color variables
  2. RED='\033[0;31m'
  3. GREEN='\033[0;32m'
  4. YELLOW='\033[0;33m'
  5. BLUE='\033[0;34m'
  6. MAGENTA='\033[0;35m'
  7. CYAN='\033[0;36m'
  8. WHITE='\033[0;37m'
  9. RESET='\033[0m'
  10.  
  11. # Define an array to hold the cheatsheet entries
  12. entries=(
  13. "sudo pacman -Rsc <pkg> -> Uninstall"
  14. "pacman -Qe -> List explicitly-installed packages"
  15. "pacman -Qs <query> -> Search installed packages for keywords"
  16. "pacman -Qm -> List non-main-repo packages"
  17. "autorem -> Remove unused packages"
  18. "ücache -> Clear yay & pacman cache"
  19. "üp -> Update .bashrc"
  20. "üü -> Show cheatsheet"
  21. "yt <video link> -> Play video on VLC"
  22. "ää -> Show program list"
  23. "ää -a <input> -> Add item to list"
  24. "ää -r <input> -> Remove item from list"
  25. "ülong -> Calibrate wheel in long mode"
  26. "üshort -> Calibrate wheel in short mode"
  27. "kü -> Wise words from stegosaurus"
  28. )
  29.  
  30. # Create the alias with colored output
  31. echo -e "${MAGENTA}#########################################################################${RESET}"
  32.  
  33. for entry in "${entries[@]}"; do
  34. cmd="${entry%%->*}"
  35. desc="${entry##*->}"
  36.  
  37. # Calculate the required padding for command column
  38. padding=$(( 25 - ${#cmd} ))
  39. padding_spaces=$(printf '%*s' $padding)
  40.  
  41. printf "${WHITE}|${RESET}${CYAN} %s${RESET}${YELLOW}->${RESET} ${GREEN}%-41s${RESET}${WHITE}|\n" "$cmd$padding_spaces" "$desc"
  42. (( count++ ))
  43. if [ $count -eq 4 ]; then
  44. echo -e "${WHITE}------------------------------------------------------------------------${RESET}"
  45. fi
  46.  
  47. done
  48.  
  49. echo -e "${MAGENTA}#########################################################################${RESET}"
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement