From f24f6ea00f245e0ba1e593f954267f7eefd59c8a Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Tue, 13 Jan 2026 18:07:21 -0500 Subject: update eww config --- bin/format-bytes | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/format-bytes (limited to 'bin/format-bytes') diff --git a/bin/format-bytes b/bin/format-bytes new file mode 100755 index 0000000..0e2e32d --- /dev/null +++ b/bin/format-bytes @@ -0,0 +1,11 @@ +#!/usr/bin/awk -f +{ + if ($1 < 1024) print int($1)" B" + else if ($1 < 1024^2) print int($1 / 1024)" KiB" + else if ($1 < 1024^3) print int($1 / 1024^2)" KiB" + else if ($1 < 1024^4) print int($1 / 1024^3)" MiB" + else if ($1 < 1024^5) print int($1 / 1024^4)" GiB" + else if ($1 < 1024^6) print int($1 / 1024^4)" TiB" + else if ($1 < 1024^7) print int($1 / 1024^4)" PiB" + else print int($1 / 1024^7)" EiB" +} -- cgit v1.2.3