1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-20 10:37:46 +01:00

18 lines
409 B
Plaintext
Raw Normal View History

2019-09-07 17:42:18 +02:00
#!/bin/sh
2023-10-17 05:18:46 +02:00
icon="^b#282828^^c#dfdfdf^  ^d^ "
2025-02-16 22:58:51 +01:00
total=$(free --mebi | awk '/^Mem:/ {print $3/$2}')
percent=$(printf %3s $(printf %-4s $total | tr ' ' '0' | cut -c1-4 | sed -e 's/\.//g' | sed -e 's/^0//g') | tr ' ' ' ')
if [ $percent -gt 75 ]
then
icon="^b#282828^^c#ff0000^ "
elif [ $percent -gt 50 ]
then
icon="^b#282828^^c#ffff00^ "
else
icon="^b#282828^^c#dfdfdf^ "
fi
echo "$icon"