cfg/.config/i3blocks/mem
Knut Ahlers ba151cf811
Update icons to fontawesome
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2019-12-23 16:01:32 +01:00

10 lines
272 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
mem_use=$(free | awk '/Mem:/{ printf "%.0f", (($2 - $7) / $2) * 100 }')
color='#ffffff'
[ ${mem_use} -gt 70 ] && color='#ffd966'
[ ${mem_use} -gt 90 ] && color='#dd0000'
printf '\uf538 <span color="%s">%.0f%%</span>\n' ${color} ${mem_use}