dotfiles/scripts/mem-plasma.2s.sh
2022-05-06 11:39:51 -05:00

12 lines
442 B
Bash
Executable file

#!/run/current-system/sw/bin/bash
# Get the percentage of used memory and print it
read used total <<< $(free -m | awk '/Mem/{printf $2" "$3}')
percent=$(bc -l <<< "100 * $total / $used")
mem=$(awk -v u=$used -v t=$total -v p=$percent 'BEGIN {printf "%sMi/%sMi %.1f% ", t, u, p}'| awk '{printf $2}')
echo "$mem | color=#9aedfe font='VictorMono Nerd Font' size=11"
# echo " $mem | color=#007687 font='VictorMono Nerd Font' size=11"