summaryrefslogtreecommitdiff
path: root/.scripts/cpu_py
diff options
context:
space:
mode:
Diffstat (limited to '.scripts/cpu_py')
-rwxr-xr-x.scripts/cpu_py2
1 files changed, 2 insertions, 0 deletions
diff --git a/.scripts/cpu_py b/.scripts/cpu_py
new file mode 100755
index 0000000..64edafe
--- /dev/null
+++ b/.scripts/cpu_py
@@ -0,0 +1,2 @@
+#!/bin/sh
+printf "%b" "import psutil\nprint('{}%'.format(psutil.cpu_percent(interval=2)))" | python3 | awk '{printf (" %2.1f%",($1))}'