#!/usr/bin/env bash
sudo apt install -y grc bat

DEST=${1:-/etc/skel}
ALIAS_DIR=".zsh_aliases.d"
ALIAS_HOME=${DEST}/${ALIAS_DIR}
ALIAS_FILE=${ALIAS_HOME}/003_grc.sh

mkdir -p "${ALIAS_HOME}"

cat >"${ALIAS_FILE}" <<'EOF'
# coloured output using grc
if [ -e /usr/bin/grc ]; then
    alias cl="/usr/bin/grc -es --colour=auto"
    alias cat="bat -p"
    alias ping="cl ping"
    alias netstat="cl netstat"
    alias traceroute="cl traceroute"
    alias diff="cl diff"
    alias tail="cl tail"
    alias ps="cl ps"
    alias lsof="cl lsof"
    alias lsmod="cl lsmod"
    alias lsattr="cl lsattr"
    alias gcc="cl gcc"
    alias make="cl make"
    alias configure="cl configure"
    alias ps="cl ps"
    alias dig="cl dig"
    alias ifconfig="cl /sbin/ifconfig"
    alias mount="cl mount"
    alias mtr="cl mtr --curses"
    alias nmap="cl nmap"
    alias ntpdate="cl ntpdate"
    alias df="cl df -hT"
    alias getfcl="cl getfcl"
    alias tail="cl tail"
    alias ip="cl ip"
    alias id="cl id"
    alias fdisk="cl fdisk"
    alias free="cl free"
    alias findmnt="cl findmnt"
    alias docker="cl docker"
    alias env="cl env"
    alias iptables="cl iptables"
    alias iwconfig="cl iwconfig"
    alias lspci="cl lspci"
    alias lsblk="cl lsblk"
    alias blkid="cl blkid"
    alias showmount="cl showmount"
    alias tcpdump="cl tcpdump"
    alias tune2fs="cl tune2fs"
    alias vmstat="cl vmstat"
    alias uptime="cl uptime"
    alias whois="cl whois"
fi
EOF
