zsh/rc.os/Linux.zsh

34 lines
769 B
Bash

alias ls='ls --color'
alias grep='grep --color'
source $ZDOTDIR/rc.os/prompt.zsh
# permit parameter expansion, command substitution and arithmetic expansion
# in prompt
setopt prompt_subst
precmd () {
local buffer load
if [ -f /proc/loadavg ];then
load=(${$(< /proc/loadavg)})
LOADAVG="$load[1]"
else
LOADAVG=$(uptime | grep -oE '[0-9]+\.[0-9][0-9]' | head --lines=1)
fi
buffer=(${$(free)})
MEM="$((100 * $buffer[16] / $buffer[8]))%%"
set_title zsh
}
# zstyle OS specific
eval `dircolors $ZDOTDIR/misc/dircolors.rc`
# Use LS_COLORS for color completion
zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS}
# Distrib specific
[ -r /etc/debian_version ] && source $ZDOTDIR/rc.os/Debian.zsh
[ -e /etc/arch-release ] && source $ZDOTDIR/rc.os/Arch.zsh