Initial commit of utility scripts

This commit is contained in:
Alex Selimov 2024-12-12 20:16:38 -05:00
parent ac77586a15
commit 1faeefffd7
34 changed files with 1328 additions and 1 deletions

15
bin/bar_mem.sh Executable file
View file

@ -0,0 +1,15 @@
#!/bin/bash
free=$(grep -oP '^MemFree: *\K[0-9]+' /proc/meminfo)
available=$(grep -oP '^MemAvailable: *\K[0-9]+' /proc/meminfo)
total=$(grep -oP '^MemTotal: *\K[0-9]+' /proc/meminfo)
mem=" $(echo "scale=1; 100*($total-$available)/$total"| bc | cut -d '.' -f1 )"
if [ $mem -gt 80 ]; then
mem="$mem"
elif [ $mem -gt 50 ]; then
mem="$mem"
else
mem="$mem"
fi
echo "$mem%"