aboutsummaryrefslogtreecommitdiffstats
path: root/basics/.local/bin/statusbar/swap
diff options
context:
space:
mode:
Diffstat (limited to 'basics/.local/bin/statusbar/swap')
-rwxr-xr-xbasics/.local/bin/statusbar/swap8
1 files changed, 8 insertions, 0 deletions
diff --git a/basics/.local/bin/statusbar/swap b/basics/.local/bin/statusbar/swap
new file mode 100755
index 0000000..787ed23
--- /dev/null
+++ b/basics/.local/bin/statusbar/swap
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+awk '
+/^SwapTotal:/ {Total=$2/(1024 * 1024)}
+/^SwapFree:/ {Free=$2/(1024 * 1024)}
+/^SwapCached:/ {Cached=$2/(1024 * 1024)}
+END {
+printf "%.2f %.2f %.2f %.2f\n", Total, Free, Cached, (Total - Free)}' /proc/meminfo