Files
dotfiles/Scripts/.local/scripts/status/memory

9 lines
256 B
Bash
Executable File

#!/usr/bin/env sh
line=$(free -m | tail -2);
used=$(echo $line | awk '{print $3}');
available=$(echo $line | awk '{print $2}');
percentage=$(echo "100 * $used / $available" | bc -l | xargs printf "%.2f" $1)
echo "$(printf "%dMB" $used) $percentage%"