Dotfiles config update (2021-01-28)
This commit is contained in:
parent
1900496dc1
commit
52cf0938f8
|
@ -1,5 +1,20 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
check_sensor=$(sensors | grep "Tdie:" 2> /dev/null)
|
||||||
|
if [ -z "${check_sensor}" ] ; then
|
||||||
|
check_sensor=$(sensors | grep "Tctl:" 2> /dev/null)
|
||||||
|
if [ -z "${check_sensor}" ] ; then
|
||||||
|
CPU_USAGE=$(~/.config/i3blocks/cpu/cpu_load.sh -p)
|
||||||
|
echo "$CPU_USAGE" | awk '{ printf(" CPU:%6s \n"), $1, $2 }'
|
||||||
|
else
|
||||||
|
TEMP=$(sensors | grep 'Package id 0:\|Tctl' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
||||||
|
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
|
||||||
|
CPU_USAGE=$(~/.config/i3blocks/cpu/cpu_load.sh -p)
|
||||||
|
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
|
||||||
|
fi
|
||||||
|
else
|
||||||
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
||||||
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
|
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
|
||||||
CPU_USAGE=$(~/.config/i3blocks/cpu/cpu_load.sh -p)
|
CPU_USAGE=$(~/.config/i3blocks/cpu/cpu_load.sh -p)
|
||||||
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
|
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
|
||||||
|
fi
|
||||||
|
|
|
@ -1,5 +1,20 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
check_sensor=$(sensors | grep "Tdie:" 2> /dev/null)
|
||||||
|
if [ -z "${check_sensor}" ] ; then
|
||||||
|
check_sensor=$(sensors | grep "Tctl:" 2> /dev/null)
|
||||||
|
if [ -z "${check_sensor}" ] ; then
|
||||||
|
CPU_USAGE=$(~/.config/polybar/cpu_load.sh -p)
|
||||||
|
echo "$CPU_USAGE" | awk '{ printf(" CPU:%6s \n"), $1, $2 }'
|
||||||
|
else
|
||||||
|
TEMP=$(sensors | grep 'Package id 0:\|Tctl' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
||||||
|
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
|
||||||
|
CPU_USAGE=$(~/.config/i3blocks/cpu/cpu_load.sh -p)
|
||||||
|
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
|
||||||
|
fi
|
||||||
|
else
|
||||||
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
||||||
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
|
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
|
||||||
CPU_USAGE=$(~/.config/i3blocks/cpu/cpu_load.sh -p)
|
CPU_USAGE=$(~/.config/i3blocks/cpu/cpu_load.sh -p)
|
||||||
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
|
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
|
||||||
|
fi
|
||||||
|
|
83
.config/polybar/cpu_load.sh
Executable file
83
.config/polybar/cpu_load.sh
Executable file
|
@ -0,0 +1,83 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script to show cpu
|
||||||
|
# Created by q3aql (q3aql@protonmail.ch)
|
||||||
|
# Licensed by GPL v.2
|
||||||
|
# Date: 10-01-2020
|
||||||
|
# --------------------------------------
|
||||||
|
VERSION="1.0"
|
||||||
|
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
cpuPercentage=$(top -b -n1 | grep \%Cpu | awk '{print 100-$8}')
|
||||||
|
showCpuPercentage=$(echo ${cpuPercentage})
|
||||||
|
showCpuPercentageInteger=$(echo ${showCpuPercentage} | cut -d "." -f 1)
|
||||||
|
|
||||||
|
# Show percentage bar
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 0 ] ; then
|
||||||
|
showCpuPercentageBar="="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 3 ] ; then
|
||||||
|
showCpuPercentageBar="=="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 12 ] ; then
|
||||||
|
showCpuPercentageBar="==="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 18 ] ; then
|
||||||
|
showCpuPercentageBar="===="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 25 ] ; then
|
||||||
|
showCpuPercentageBar="====="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 35 ] ; then
|
||||||
|
showCpuPercentageBar="======"
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 40 ] ; then
|
||||||
|
showCpuPercentageBar="======="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 45 ] ; then
|
||||||
|
showCpuPercentageBar="========"
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 50 ] ; then
|
||||||
|
showCpuPercentageBar="=========="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 62 ] ; then
|
||||||
|
showCpuPercentageBar="============="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 75 ] ; then
|
||||||
|
showCpuPercentageBar="==============="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 85 ] ; then
|
||||||
|
showCpuPercentageBar="================="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 90 ] ; then
|
||||||
|
showCpuPercentageBar="=================="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 95 ] ; then
|
||||||
|
showCpuPercentageBar="==================="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 100 ] ; then
|
||||||
|
showCpuPercentageBar="===================="
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Show results
|
||||||
|
if [ "$1" == "-p" ]; then
|
||||||
|
echo ${showCpuPercentage}%
|
||||||
|
elif [ "$1" == "-b" ]; then
|
||||||
|
echo ${showCpuPercentageBar}
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo " cpuinfo v$VERSION"
|
||||||
|
echo " ------------"
|
||||||
|
echo ""
|
||||||
|
echo " CpuPercentage Use:"
|
||||||
|
echo " ${showCpuPercentageBar} ${showCpuPercentage}%"
|
||||||
|
echo ""
|
||||||
|
echo " Available commands:"
|
||||||
|
echo ""
|
||||||
|
echo " cpuinfo.sh -p | Show CpuPercentage"
|
||||||
|
echo " cpuinfo.sh -b | Show CpuPercentage Bar"
|
||||||
|
echo ""
|
||||||
|
echo " Note: Conky require 'maximum_width = 240'"
|
||||||
|
echo ""
|
||||||
|
fi
|
|
@ -87,6 +87,28 @@ kernel() {
|
||||||
|
|
||||||
## CPU
|
## CPU
|
||||||
cpu() {
|
cpu() {
|
||||||
|
check_sensor=$(sensors | grep "Tdie:" 2> /dev/null)
|
||||||
|
if [ -z "${check_sensor}" ] ; then
|
||||||
|
check_sensor=$(sensors | grep "Tctl:" 2> /dev/null)
|
||||||
|
if [ -z "${check_sensor}" ] ; then
|
||||||
|
read cpu a b c previdle rest < /proc/stat
|
||||||
|
prevtotal=$((a+b+c+previdle))
|
||||||
|
sleep 0.5
|
||||||
|
read cpu a b c idle rest < /proc/stat
|
||||||
|
total=$((a+b+c+idle))
|
||||||
|
cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
|
||||||
|
echo -e "CPU: $cpu%"
|
||||||
|
else
|
||||||
|
TEMP=$(sensors | grep 'Package id 0:\|Tctl' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
||||||
|
read cpu a b c previdle rest < /proc/stat
|
||||||
|
prevtotal=$((a+b+c+previdle))
|
||||||
|
sleep 0.5
|
||||||
|
read cpu a b c idle rest < /proc/stat
|
||||||
|
total=$((a+b+c+idle))
|
||||||
|
cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
|
||||||
|
echo -e "CPU: $cpu% @ ${TEMP}"
|
||||||
|
fi
|
||||||
|
else
|
||||||
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
||||||
read cpu a b c previdle rest < /proc/stat
|
read cpu a b c previdle rest < /proc/stat
|
||||||
prevtotal=$((a+b+c+previdle))
|
prevtotal=$((a+b+c+previdle))
|
||||||
|
@ -95,6 +117,7 @@ cpu() {
|
||||||
total=$((a+b+c+idle))
|
total=$((a+b+c+idle))
|
||||||
cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
|
cpu=$((100*( (total-prevtotal) - (idle-previdle) ) / (total-prevtotal) ))
|
||||||
echo -e "CPU: $cpu% @ ${TEMP}"
|
echo -e "CPU: $cpu% @ ${TEMP}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
## VOLUME
|
## VOLUME
|
||||||
|
|
|
@ -1,5 +1,20 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
check_sensor=$(sensors | grep "Tdie:" 2> /dev/null)
|
||||||
|
if [ -z "${check_sensor}" ] ; then
|
||||||
|
check_sensor=$(sensors | grep "Tctl:" 2> /dev/null)
|
||||||
|
if [ -z "${check_sensor}" ] ; then
|
||||||
|
CPU_USAGE=$(~/.config/waybar/scripts/cpu_load.sh -p)
|
||||||
|
echo "$CPU_USAGE" | awk '{ printf(" CPU:%6s \n"), $1, $2 }'
|
||||||
|
else
|
||||||
|
TEMP=$(sensors | grep 'Package id 0:\|Tctl' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
||||||
|
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
|
||||||
|
CPU_USAGE=$(~/.config/i3blocks/cpu/cpu_load.sh -p)
|
||||||
|
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
|
||||||
|
fi
|
||||||
|
else
|
||||||
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
TEMP=$(sensors | grep 'Package id 0:\|Tdie' | grep ':[ ]*+[0-9]*.[0-9]*°C' -o | grep '+[0-9]*.[0-9]*°C' -o)
|
||||||
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
|
#CPU_USAGE=$(mpstat 1 1 | awk '/Average:/ {printf("%s\n", $(NF-9))}')
|
||||||
CPU_USAGE=$(~/.config/i3blocks/cpu/cpu_load.sh -p)
|
CPU_USAGE=$(~/.config/i3blocks/cpu/cpu_load.sh -p)
|
||||||
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
|
echo "$CPU_USAGE $TEMP" | awk '{ printf(" CPU:%6s @ %s \n"), $1, $2 }'
|
||||||
|
fi
|
||||||
|
|
83
.config/waybar/scripts/cpu_load.sh
Executable file
83
.config/waybar/scripts/cpu_load.sh
Executable file
|
@ -0,0 +1,83 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Script to show cpu
|
||||||
|
# Created by q3aql (q3aql@protonmail.ch)
|
||||||
|
# Licensed by GPL v.2
|
||||||
|
# Date: 10-01-2020
|
||||||
|
# --------------------------------------
|
||||||
|
VERSION="1.0"
|
||||||
|
|
||||||
|
|
||||||
|
# Variables
|
||||||
|
cpuPercentage=$(top -b -n1 | grep \%Cpu | awk '{print 100-$8}')
|
||||||
|
showCpuPercentage=$(echo ${cpuPercentage})
|
||||||
|
showCpuPercentageInteger=$(echo ${showCpuPercentage} | cut -d "." -f 1)
|
||||||
|
|
||||||
|
# Show percentage bar
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 0 ] ; then
|
||||||
|
showCpuPercentageBar="="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 3 ] ; then
|
||||||
|
showCpuPercentageBar="=="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 12 ] ; then
|
||||||
|
showCpuPercentageBar="==="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 18 ] ; then
|
||||||
|
showCpuPercentageBar="===="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 25 ] ; then
|
||||||
|
showCpuPercentageBar="====="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 35 ] ; then
|
||||||
|
showCpuPercentageBar="======"
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 40 ] ; then
|
||||||
|
showCpuPercentageBar="======="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 45 ] ; then
|
||||||
|
showCpuPercentageBar="========"
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 50 ] ; then
|
||||||
|
showCpuPercentageBar="=========="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 62 ] ; then
|
||||||
|
showCpuPercentageBar="============="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 75 ] ; then
|
||||||
|
showCpuPercentageBar="==============="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 85 ] ; then
|
||||||
|
showCpuPercentageBar="================="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 90 ] ; then
|
||||||
|
showCpuPercentageBar="=================="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 95 ] ; then
|
||||||
|
showCpuPercentageBar="==================="
|
||||||
|
fi
|
||||||
|
if [ ${showCpuPercentageInteger} -ge 100 ] ; then
|
||||||
|
showCpuPercentageBar="===================="
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Show results
|
||||||
|
if [ "$1" == "-p" ]; then
|
||||||
|
echo ${showCpuPercentage}%
|
||||||
|
elif [ "$1" == "-b" ]; then
|
||||||
|
echo ${showCpuPercentageBar}
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
echo " cpuinfo v$VERSION"
|
||||||
|
echo " ------------"
|
||||||
|
echo ""
|
||||||
|
echo " CpuPercentage Use:"
|
||||||
|
echo " ${showCpuPercentageBar} ${showCpuPercentage}%"
|
||||||
|
echo ""
|
||||||
|
echo " Available commands:"
|
||||||
|
echo ""
|
||||||
|
echo " cpuinfo.sh -p | Show CpuPercentage"
|
||||||
|
echo " cpuinfo.sh -b | Show CpuPercentage Bar"
|
||||||
|
echo ""
|
||||||
|
echo " Note: Conky require 'maximum_width = 240'"
|
||||||
|
echo ""
|
||||||
|
fi
|
2
.vimrc
2
.vimrc
|
@ -18,6 +18,8 @@ let $NVIM_TUI_ENABLE_TRUE_COLOR=1
|
||||||
" Hide menu/toolbar of GVIM
|
" Hide menu/toolbar of GVIM
|
||||||
":set guioptions -=m
|
":set guioptions -=m
|
||||||
:set guioptions -=T
|
:set guioptions -=T
|
||||||
|
:set guioptions -=r
|
||||||
|
:set guioptions -=L
|
||||||
|
|
||||||
" Helps force plug-ins to load correctly when it is turned back on below.
|
" Helps force plug-ins to load correctly when it is turned back on below.
|
||||||
filetype off
|
filetype off
|
||||||
|
|
Loading…
Reference in New Issue
Block a user