Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Sep 18th, 2012  |  syntax: None  |  size: 0.54 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2. # color output of -Ss
  3.  
  4. [[ -n "$PACMAN" ]] || {
  5.    PACMAN="pacman"
  6. }
  7.  
  8. C[0]="\033[33m" # core
  9. C[1]="\033[34m" # extra
  10. C[2]="\033[32m" # community
  11. C[3]="\033[35m" # multilib
  12. C[4]="\033[31m" # other
  13. "$PACMAN" -Ss "$@" | \
  14.       sed "s/^core\//`printf "${C[0]}core\033[0m\/"`/" | \
  15.       sed "s/^extra\//`printf "${C[1]}extra\033[0m\/"`/" | \
  16.       sed "s/^community\//`printf "${C[2]}community\033[0m\/"`/" | \
  17.       sed "s/^multilib\//`printf "${C[3]}multilib\033[0m\/"`/" | \
  18.       sed "s/^\([^ ].*\)\//`printf "${C[4]}"`\1`printf "\033[0m\/"`/"