Initial commit for build of dwmblocks
This commit is contained in:
commit
e60906dbc6
14 changed files with 416 additions and 0 deletions
15
scripts/bar_mem.sh
Executable file
15
scripts/bar_mem.sh
Executable 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%"
|
Loading…
Add table
Add a link
Reference in a new issue