More schreenshots uploaded here.
Commands Colorized so far...
- zpool
- zfs
- geom
- gpart
- geli
- pfctl
- sockstat
- pciconf
- usbconfig
- vnstat
The idea is faily simple - Install grc
using pkg-ng (pkg install grc
) and create conf files for various FreeBSD CLI utilities.
Put the attached files under /usr/local/share/grc
directory, and then modify /usr/local/etc/grc.conf
as shown below. After that running these commands prefixed with grc
will give you colorized output. e.g. grc pfctl -s rules
.
NOTE: I've selected the colors and segments I want to highlight based on my tastes. Feel free to modify as per your tastes.
# Put these at the end of /usr/local/etc/grc.conf
# -----------------------------------------------------------------
# # pciconf
(^|[/\w\.]+/)pciconf\s?
conf.pciconf
# # usbconfig
(^|[/\w\.]+/)usbconfig\s?
conf.usbconfig
# # usbconfig
(^|[/\w\.]+/)sockstat\s?
conf.sockstat
# # vnstat
(^|[/\w\.]+/)vnstat\s?
conf.vnstat
# # geli
(^|[/\w\.]+/)geli\s?
conf.geli
# # geom
(^|[/\w\.]+/)geom\s?
conf.geom
# # gpart
(^|[/\w\.]+/)gpart\s?
conf.gpart
# # pfctl
(^|[/\w\.]+/)pfctl\s?
conf.pfctl
# # zpool
(^|[/\w\.]+/)zpool\s?
conf.zpool
# # zfs
(^|[/\w\.]+/)zfs\s?
conf.zfs
If you were to continue this work, a good reference for utilities that this can be applied to would be https://man.freebsd.org/stats(7) :)