This commit is contained in:
Ray Elliott 2022-03-22 13:00:31 +00:00
parent 05591fc6e8
commit fa852885e5
1 changed files with 31 additions and 0 deletions

31
bashrc
View File

@ -27,3 +27,34 @@ export NVM_DIR="$HOME/.nvm"
# https://github.com/skywind3000/z.lua
eval "$(lua $HOME/.z.lua/z.lua --init bash enhanced once echo)"
_mem_available=$(awk '/MemAvailable/ { printf "%.1f \n", $2/1024/1024 }' /proc/meminfo)
_updates_available="$(cat $HOME/.checkupdates)"
[ -z $_updates_available ] && _updates_available="0"
echo "Remember your aliases:"
echo " containers"
echo " e cdlf lfcd"
echo " mc newsh smartresize"
echo " b1 kvm mike p1 pve"
echo ""
if [ ${_mem_available%.*} -lt 5 ] ; then
echo -n "Memory available: "
[ ${_mem_available%.*} -lt 3 ] && echo -ne "\033[0;31m"
echo -n "${_mem_available}"
[ ${_mem_available%.*} -lt 3 ] && echo -ne "\033[0m"
echo "GB"
fi
if [ $_updates_available -gt 0 ] ; then
echo -n "Updates available: "
[ $_updates_available -gt 9 ] && echo -ne "\033[0;31m"
echo -n "$_updates_available"
[ $_updates_available -gt 9 ] && echo -ne "\033[0m"
echo ""
fi
echo ""
(checkupdates > "$HOME/.checkupdates") & disown