Skip to content

Instantly share code, notes, and snippets.

@M4cs
Last active March 23, 2024 20:32
Show Gist options
  • Save M4cs/3aef2fa4e081207daf8b07d46db7e224 to your computer and use it in GitHub Desktop.
Save M4cs/3aef2fa4e081207daf8b07d46db7e224 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