Skip to content

Instantly share code, notes, and snippets.

@Cloudef
Created August 5, 2012 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cloudef/3260717 to your computer and use it in GitHub Desktop.
Save Cloudef/3260717 to your computer and use it in GitHub Desktop.
quick dirty color for -Ss
#!/bin/sh
# color output of -Ss
[[ -n "$PACMAN" ]] || {
PACMAN="pacman"
}
C[0]="\033[33m" # core
C[1]="\033[34m" # extra
C[2]="\033[32m" # community
C[3]="\033[35m" # multilib
C[4]="\033[31m" # other
"$PACMAN" -Ss "$@" | \
sed "s/^core\//`printf "${C[0]}core\033[0m\/"`/" | \
sed "s/^extra\//`printf "${C[1]}extra\033[0m\/"`/" | \
sed "s/^community\//`printf "${C[2]}community\033[0m\/"`/" | \
sed "s/^multilib\//`printf "${C[3]}multilib\033[0m\/"`/" | \
sed "s/^\([^ ].*\)\//`printf "${C[4]}"`\1`printf "\033[0m\/"`/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment