Dotfiles config update (2021-11-20)

This commit is contained in:
q3aql 2021-11-20 14:23:01 +01:00
parent 9aab3e4575
commit 46557bc434
3 changed files with 38 additions and 5 deletions

View File

@ -9,20 +9,51 @@ hdd() {
## RAM ## RAM
mem() { mem() {
mem=`free | awk '/Mem/ {printf "%dM/%dM\n", $3 / 1024.0, $2 / 1024.0 }'` # Disable show meminfo
echo -e "$mem" #mem=`free | awk '/Mem/ {printf "%dM/%dM\n", $3 / 1024.0, $2 / 1024.0 }'`
#echo -e "$mem"
# Enable meminfo in GiB
memfile="/proc/meminfo"
size="G" # Change to M for MiB
# Variables
memTotal=$(cat ${memfile} | grep -i "memtotal:" | head -1 | tr -s " " | cut -d " " -f 2)
memActive=$(cat ${memfile} | grep -i "memavailable:" | head -1 | tr -s " " | cut -d " " -f 2)
memActive=$(expr ${memTotal} - ${memActive})
# Variables to calculate
memTotalM=$(expr ${memTotal} / 1024 )
memActiveM=$(expr ${memActive} / 1024)
memTotalG=$(calc ${memTotalM} / 1024 | tr -s " " | cut -c1-5)
memActiveG=$(calc ${memActiveM} / 1024 | tr -s " " | cut -c1-5)
# Variables to show
if [ "${size}" == "G" ] ; then
showMemTotal="${memTotalG}G"
showMemActive="${memActiveG}G"
elif [ "${size}" == "M" ] ; then
showMemTotal="${memTotalM}M"
showMemActive="${memActiveM}M"
else
showMemTotal="${memTotalG}G"
showMemActive="${memActiveG}G"
fi
show_mem_bar=$(echo ${showMemActive} /${showMemTotal})
echo -e ${show_mem_bar} | tr -s " "
} }
## DATE AND TIME ## DATE AND TIME
date_today() { date_today() {
day_hour=$(date "+%a,%d %h [%H:%M]") day_hour=$(date "+%a,%d %h [%H:%M]")
echo "${day_hour}" echo -e "${day_hour}"
} }
## DATE AND TIME (CUT) ## DATE AND TIME (CUT)
date_today_cut() { date_today_cut() {
day_hour=$(date "+%H:%M") day_hour=$(date "+%H:%M")
echo "${day_hour}" echo -e "${day_hour}"
} }
# KERNEL # KERNEL
@ -50,7 +81,7 @@ kernel() {
kernelVersion=${kernelVersion}${kernelVersionTempDot} kernelVersion=${kernelVersion}${kernelVersionTempDot}
# Apply arch # Apply arch
kernelVersion=${kernelVersion} kernelVersion=${kernelVersion}
echo "Linux ${kernelVersion}" echo -e "Linux ${kernelVersion}"
} }
## CPU ## CPU

View File

@ -127,6 +127,7 @@ My list of extra combinations:
* [Antonio Sarosi](https://github.com/antoniosarosi/dotfiles/) * [Antonio Sarosi](https://github.com/antoniosarosi/dotfiles/)
* [Derek Taylor](https://gitlab.com/dwt1/dotfiles/) * [Derek Taylor](https://gitlab.com/dwt1/dotfiles/)
* [TWB0109](https://github.com/TWB0109/PDots)
* [i3-style](https://github.com/altdesktop/i3-style) * [i3-style](https://github.com/altdesktop/i3-style)
* [addy-dclxvi](https://github.com/addy-dclxvi/i3-starterpack) * [addy-dclxvi](https://github.com/addy-dclxvi/i3-starterpack)
* [i3-gaps](https://github.com/Airblader/i3) * [i3-gaps](https://github.com/Airblader/i3)

View File

@ -117,6 +117,7 @@ My list of extra combinations:
* [Antonio Sarosi](https://github.com/antoniosarosi/dotfiles/) * [Antonio Sarosi](https://github.com/antoniosarosi/dotfiles/)
* [Derek Taylor](https://gitlab.com/dwt1/dotfiles/) * [Derek Taylor](https://gitlab.com/dwt1/dotfiles/)
* [TWB0109](https://github.com/TWB0109/PDots)
* [i3-style](https://github.com/altdesktop/i3-style) * [i3-style](https://github.com/altdesktop/i3-style)
* [addy-dclxvi](https://github.com/addy-dclxvi/i3-starterpack) * [addy-dclxvi](https://github.com/addy-dclxvi/i3-starterpack)
* [i3-gaps](https://github.com/Airblader/i3) * [i3-gaps](https://github.com/Airblader/i3)