Skip to content

Instantly share code, notes, and snippets.

@carepack
Forked from M4cs/istats.py
Created October 1, 2020 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carepack/19a0c0d69cc1fc93bd2116c6c80f4974 to your computer and use it in GitHub Desktop.
Save carepack/19a0c0d69cc1fc93bd2116c6c80f4974 to your computer and use it in GitHub Desktop.
Getting iStats Widget
import os
import time
import subprocess
while True:
output = subprocess.check_output(['istats', 'cpu'])
output1 = subprocess.check_output(['istats', 'fan'])
output2 = subprocess.check_output(['istats', 'battery'])
new_output = '\n\n\n' + str(output.decode('utf-8')) + '\n' + str(output1.decode('utf-8')) + '\n' + str(output2.decode('utf-8'))
print(new_output.replace('For more stats run `istats extra` and follow the instructions.', ''))
time.sleep(5)
os.system('clear')

Setup

Start by installing iStats with gem

gem install iStats

Then copy the python script above to a file on your computer (easiest to place wherever your terminal opens to)

Setup iTerm to be titless and scrollbarless (may require Nightly build)

Run the script and youll have a terminal widget with system info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment