diff options
author | ryo <ryo@nopwd.lol> | 2024-10-30 20:10:03 +0000 |
---|---|---|
committer | ryo <ryo@nopwd.lol> | 2024-10-30 20:10:03 +0000 |
commit | cc6d6fcfc6e8403e87dae9f092e61f0edf8e3cc6 (patch) | |
tree | f7f751a92c30b5ef7cf8770004c30479c516fdca /config/i3blocks/scripts/ram |
Initial commit
Diffstat (limited to 'config/i3blocks/scripts/ram')
-rwxr-xr-x | config/i3blocks/scripts/ram | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/config/i3blocks/scripts/ram b/config/i3blocks/scripts/ram new file mode 100755 index 0000000..ebf8309 --- /dev/null +++ b/config/i3blocks/scripts/ram @@ -0,0 +1,14 @@ +#!/usr/bin/env dash + +ram=$(awk ' +/MemTotal/ { total = $2 } +/Active:/ { active = $2 } +END {print int((active/total)*100)} +' /proc/meminfo) + +echo ": $ram%" +echo "R: $ram" + +if [ "$ram" -gt 80 ]; then + echo "#FF0000" +fi |