Call the grc graphic terminal for all commands implicitly

I like the grc graphics editor for the terminal. However, I have to explicitly attach everything I want with:

grc --config=conf.mine 

Is there a way to automatically apply it to everything you type on the command line (so maybe I don't even need to know what grc is)? Perhaps using shells if there is no better alternative?

+4
source share
2 answers

grc.bashrc and grc.zsh files using grc, since v1.9 does this (incomplete) by adding aliases for common commands:

grc.bashrc

 GRC=`which grc` if [ "$TERM" != dumb ] && [ -n "$GRC" ] then alias colourify="$GRC -es --colour=auto" alias configure='colourify ./configure' alias diff='colourify diff' alias make='colourify make' alias gcc='colourify gcc' alias g++='colourify g++' alias as='colourify as' alias gas='colourify gas' alias ld='colourify ld' alias netstat='colourify netstat' alias ping='colourify ping' alias traceroute='colourify /usr/sbin/traceroute' alias head='colourify head' alias tail='colourify tail' alias dig='colourify dig' alias mount='colourify mount' alias ps='colourify ps' alias mtr='colourify mtr' alias df='colourify df' fi 

grc.zsh

 if [[ "$TERM" != dumb ]] && (( $+commands[grc] )) ; then # Prevent grc aliases from overriding zsh completions. setopt COMPLETE_ALIASES # Supported commands cmds=( cc \ configure \ cvs \ df \ diff \ dig \ gcc \ gmake \ ifconfig \ last \ ldap \ ls \ make \ mount \ mtr \ netstat \ ping \ ping6 \ ps \ traceroute \ traceroute6 \ wdiff \ ); # Set alias for available commands. for cmd in $cmds ; do if (( $+commands[$cmd] )) ; then alias $cmd="grc --colour=auto $cmd" fi done # Clean up variables unset cmds cmd fi 
+4
source

I tried this and it worked for me:

 alias ls="ls -FHG" 
0
source

All Articles