Dotfiles config update (2022-04-15)

This commit is contained in:
q3aql 2022-04-15 14:25:59 +02:00
parent a4ec4f6e28
commit 75b695396f
2 changed files with 50 additions and 18 deletions

17
.bashrc
View File

@ -149,12 +149,13 @@ alias ll='ls -l'
alias la='ls -A' alias la='ls -A'
alias l='ls -CF' alias l='ls -CF'
# Load terminal
echo "" echo ""
echo -e -n "\e[32m# Preparing to start \e[0m\e[35mbash\e[0m \e[32mshell...\e[0m" echo -e -n "\e[32m# Preparing to start \e[0m\e[35mbash\e[0m \e[32mshell...\e[0m"
#os_system="Devuan 4" #os_system="Devuan 4"
os_system=$(lsb_release -d 2> /dev/null | tr -s " " | cut -d ":" -f 2) os_system=$(lsb_release -d 2> /dev/null | tr -s " " | cut -d ":" -f 2)
if [ -z "${os_system}" ] ; then if [ -z "${os_system}" ] ; then
os_system="Unknown" os_system=$(uname -o)
else else
os_system=$(echo ${os_system}) os_system=$(echo ${os_system})
fi fi
@ -182,14 +183,14 @@ elif [ -f /usr/bin/lscpu ] ; then
else else
cpu_model="Unknown" cpu_model="Unknown"
fi fi
if [ -f /usr/bin/lsmem ] ; then if [ -f /proc/meminfo ] ; then
mem_total=$(lsmem | grep "Total online memory:" | tr -s " " | cut -d ":" -f 2)
mem_total=$(echo ${mem_total})
elif [ -f /proc/meminfo ] ; then
mem_total_kb=$(cat /proc/meminfo | grep -i "memtotal" | tr -s " " | cut -d ":" -f 2) mem_total_kb=$(cat /proc/meminfo | grep -i "memtotal" | tr -s " " | cut -d ":" -f 2)
mem_total_kb_num=$(echo ${mem_total_kb} | cut -d " " -f 1) mem_total_kb_num=$(echo ${mem_total_kb} | tr -s " " | cut -d " " -f 1)
mem_total_gb=$(expr ${mem_total_kb_num} / 1024 / 1024) mem_total_gb=$(expr ${mem_total_kb_num} / 1000 / 1000)
mem_total=$(echo ${mem_total_gb}) mem_total=$(echo ${mem_total_gb}G)
elif [ -f /usr/bin/lsmem ] ; then
mem_total=$(lsmem | grep -i "total online memory:" | tr -s " " | cut -d ":" -f 2)
mem_total=$(echo ${mem_total})
else else
mem_total="Unknown" mem_total="Unknown"
fi fi

51
.zshrc
View File

@ -232,28 +232,59 @@ fi
# some more ls aliases # some more ls aliases
alias grep='grep --color=auto' alias grep='grep --color=auto'
alias cat='batcat --style=plain --paging=never' if [ -f /usr/bin/batcat ] ; then
alias ls='exa --group-directories-first' alias cat='batcat --style=plain --paging=never'
alias tree='exa -T' elif [ -f /usr/bin/bat ] ; then
alias cat='bat --style=plain --paging=never'
fi
if [ -f /usr/bin/exa ] ; then
alias ls='exa --group-directories-first'
alias tree='exa -T'
else
alias ls="ls --color=auto"
fi
alias ll='ls -l' alias ll='ls -l'
alias la='ls -A' alias la='ls -A'
alias l='ls -CF' alias l='ls -CF'
# Load terminal
echo ""
echo -e -n "\e[32m# Preparing to start \e[0m\e[35mzsh\e[0m \e[32mshell...\e[0m"
os_system=$(uname -o) os_system=$(uname -o)
kernel=$(uname -r) kernel=$(uname -r)
uptime=$(uptime | tr -s " " | cut -d "," -f 1) uptime=$(uptime 2> /dev/null | tr -s " " | cut -d "," -f 1)
uptime=$(echo ${uptime}) if [ -z "${uptime}" ] ; then
uptime="Unknown"
else
uptime=$(echo ${uptime})
fi
#shell="5.8" # Run zsh --version #shell="5.8" # Run zsh --version
shell=$(zsh --version | cut -d " " -f 2) shell=$(zsh --version | cut -d " " -f 2)
resolution=$(xrandr 2> /dev/null | grep "*" | head -1 | tr -s " " | cut -d " " -f 2) resolution=$(xrandr 2> /dev/null | grep "*" | head -1 | tr -s " " | cut -d " " -f 2)
user_loaded=$(whoami) user_loaded=$(whoami)
home_user="${HOME}" home_user="${HOME}"
cpu_model=$(lscpu | grep "Model name:" | tr -s " " | cut -d ":" -f 2) if [ -f /proc/cpuinfo ] ; then
cpu_model=$(echo ${cpu_model}) cpu_model=$(cat /proc/cpuinfo | grep -i "model name" | head -1 | tr -s " " | cut -d ":" -f 2)
mem_total=$(lsmem | grep "Total online memory:" | tr -s " " | cut -d ":" -f 2) cpu_model=$(echo ${cpu_model})
mem_total=$(echo ${mem_total}) elif [ -f /usr/bin/lscpu ] ; then
cpu_model=$(lscpu 2>/dev/null | grep -i "Model name:" | tr -s " " | cut -d ":" -f 2)
cpu_model=$(echo ${cpu_model})
else
cpu_model="Unknown"
fi
if [ -f /proc/meminfo ] ; then
mem_total_kb=$(cat /proc/meminfo | grep -i "memtotal" | tr -s " " | cut -d ":" -f 2)
mem_total_kb_num=$(echo ${mem_total_kb} | tr -s " " | cut -d " " -f 2)
mem_total_gb=$(expr ${mem_total_kb_num} / 1000 / 1000)
mem_total=$(echo ${mem_total_gb}G)
elif [ -f /usr/bin/lsmem ] ; then
mem_total=$(lsmem | grep -i "total online memory:" | tr -s " " | cut -d ":" -f 2)
mem_total=$(echo ${mem_total})
else
mem_total="Unknown"
fi
arch_system=$(uname -m) arch_system=$(uname -m)
hostname=$(hostname) hostname=${HOST}
session_type="${XDG_SESSION_TYPE}" session_type="${XDG_SESSION_TYPE}"
clear clear