From 7e98851872fa95541bc22864306b96964f4c0bdd Mon Sep 17 00:00:00 2001 From: Matthias Winkelmann Date: Tue, 28 Mar 2017 05:19:42 +0200 Subject: [PATCH] Improved shell integration and instructions --- README.markdown | 19 +++++++++++++------ grc.fish | 25 +++++++++++++++++-------- 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/README.markdown b/README.markdown index 0f92fd9..1c63e94 100644 --- a/README.markdown +++ b/README.markdown @@ -1,7 +1,6 @@ # Generic Colouriser -Radovan Garabík http://kassiopeia.juls.savba.sk/~garabik/software/grc.html -garabik @ kassiopeia.juls.savba.sk +Radovan Garabík (garabik @ kassiopeia.juls.savba.sk) For the impatient - try following commands: @@ -130,7 +129,7 @@ in your `/etc/grc.conf`, then typing `grc cat /var/log/syslog` will use `conf.lo ## Miscellaneous remarks: You should get yourself familiar with regular expressions. Good reading is -at http://docs.python.org/dev/howto/regex.html +at The program is not yet optimized for speed. There are places that can give a big boost if optimized. @@ -178,16 +177,24 @@ or, if you have recent BSD tail: tail -F /var/log/syslog | grcat conf.log >/dev/tty12 -If you want to start using grc automatically with supported commands, add +## Automatic aliases - source /etc/grc.bashrc +You can start using grc automatically with supported commands. The following assumes that `grc.` is in `/etc`. The location may differ (i. e. `/usr/local/etc` when installed with homebrew). + +### Bash To set aliases for supported commands, append to your `~/.bashrc`: + [[ -s "/etc/grc.bashrc" ]] && source /etc/grc.bashrc +### ZSH + Or for zsh users, append to `~/.zshrc`: + [[ -s "/etc/grc.zsh" ]] && source /etc/grc.zsh -(assuming you copied `grc.bashrc` and `grc.zsh` to `/etc`) +### Fish +Add to `~/.config/fish/config.fish` or in a new file in `~/.config/fish/conf.d/`: + source /usr/local/etc/grc.fish diff --git a/grc.fish b/grc.fish index 15e1c76..a7e63e8 100644 --- a/grc.fish +++ b/grc.fish @@ -1,11 +1,20 @@ #!/usr/bin/env fish -# Main File: ~/.local/share/omf/pkg/grc/init.fish -# echo $grc_plugin_execs +# +# To load in ~/.config/fish/fish.conf or a new file in +# ~/.config/fish/conf.d add: +# source /etc/grc.fish (path may depend on install method) +# +# See also the plugin at https://github.com/oh-my-fish/plugin-grc set -U grc_plugin_execs cat cvs df diff dig gcc g++ ls ifconfig \ - make mount mtr netstat ping ps tail traceroute \ - wdiff \ - blkid du docker docker-machine env ip iostat \ - last lsattr lsblk lspci lsmod getfacl getsebool ulimit uptime nmap \ - free semanage sar ss sysctl systemctl stat showmount tune2fs \ - vmstat w who + make mount mtr netstat ping ps tail traceroute \ + wdiff blkid du docker docker-machine env ip iostat \ + last lsattr lsblk lspci lsmod getfacl getsebool ulimit uptime nmap \ + free semanage sar ss sysctl systemctl stat showmount tune2fs \ + vmstat w who + +for executable in $grc_plugin_execs + if type -q $executable + alias $executable "grc $executable" + end +end