#!/usr/bin/env bash
free --si | awk '/Swap/ {
  used=$3; total=$2
  u = sprintf("%.1fG", used/1000000)
  t = sprintf("%.1fG", total/1000000)
  printf "{\"used\":%d,\"total\":%d,\"human\":{\"used\":\"%s\",\"total\":\"%s\"}}\n", used, total, u, t
}'
