Dotfiles config update (2022-04-15)
This commit is contained in:
parent
6b78761509
commit
a4ec4f6e28
65
.bashrc
65
.bashrc
|
@ -134,31 +134,72 @@ esac
|
||||||
|
|
||||||
# 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'
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
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 | tr -s " " | cut -d ":" -f 2)
|
os_system=$(lsb_release -d 2> /dev/null | tr -s " " | cut -d ":" -f 2)
|
||||||
os_system=$(echo ${os_system})
|
if [ -z "${os_system}" ] ; then
|
||||||
|
os_system="Unknown"
|
||||||
|
else
|
||||||
|
os_system=$(echo ${os_system})
|
||||||
|
fi
|
||||||
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.1.4" # Run bash --version
|
#shell="5.1.4" # Run bash --version
|
||||||
shell=$(bash --version | head -1 | tr -s " " | cut -d " " -f 4 | cut -d "(" -f 1 | cut -d "-" -f 1)
|
shell=$(bash --version | head -1 | tr -s " " | cut -d " " -f 4 | cut -d "(" -f 1 | cut -d "-" -f 1)
|
||||||
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)
|
||||||
|
if [ -z "${resolution}" ] ; then
|
||||||
|
resolution="No display"
|
||||||
|
fi
|
||||||
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 /usr/bin/lsmem ] ; 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_num=$(echo ${mem_total_kb} | cut -d " " -f 1)
|
||||||
|
mem_total_gb=$(expr ${mem_total_kb_num} / 1024 / 1024)
|
||||||
|
mem_total=$(echo ${mem_total_gb})
|
||||||
|
else
|
||||||
|
mem_total="Unknown"
|
||||||
|
fi
|
||||||
arch_system="${HOSTTYPE}"
|
arch_system="${HOSTTYPE}"
|
||||||
hostname="${HOSTNAME}"
|
hostname="${HOSTNAME}"
|
||||||
session_type="${XDG_SESSION_TYPE}"
|
if [ -z "${XDG_SESSION_TYPE}" ] ; then
|
||||||
|
session_type="tty"
|
||||||
|
else
|
||||||
|
session_type="${XDG_SESSION_TYPE}"
|
||||||
|
fi
|
||||||
|
|
||||||
clear
|
clear
|
||||||
echo -e " "
|
echo -e " "
|
||||||
|
|
Loading…
Reference in New Issue
Block a user