Accessing system information with ease using Python (battery, cpu, gpu, disk, memory, and network).

While working to create a complete redesign of the Touch Bar I came to the dismaying realization that there is no "one-solution-for-all" for easy access to critical system information. With this realization in mind I decided to build a very simple Python project that allows the user to easily pull system information without much hassle within BetterTouchTool.

The project is mainly a wrapper for psutil and iStats, but once installed it makes the life of anyone trying to display system information in the Touch Bar extremely easy. The project is called Tocco, and you can view its source code directly here. With Tocco, you can pull the following information with easy:

import tocco

# Battery
print(tocco.battery.percent)
print(tocco.battery.hours_left)

# CPU
print(tocco.cpu.percent)
print(tocco.cpu.temperature.C)
print(tocco.cpu.temperature.F)

# GPU
print(tocco.gpu.temperature.C)
print(tocco.gpu.temperature.F)

# Fan
print(tocco.fans.rpm)

# Disk
print(tocco.disk.total)
print(tocco.disk.used)
print(tocco.disk.free)
print(tocco.disk.percent)

# Memory
print(tocco.memory.total)
print(tocco.memory.available)
print(tocco.memory.used)
print(tocco.memory.free)
print(tocco.memory.active)
print(tocco.memory.inactive)
print(tocco.memory.wired)
print(tocco.memory.percent)

# Network
print(tocco.network.sent_last_sec)
print(tocco.network.received_last_sec)

Installing

To install Tocco you may either do so via the express installation here or by doing the following:

  1. Install iStats via gem, sudo gem install iStats
  2. Install Brew via brew.sh
  3. Install Python3 via brew, brew install python3
  4. Install Tocco via Python3, /usr/local/bin/python3 -m pip install git+http://github.com/synchronizing/Tocco

Using

After proper installation (detailed below) you are a step away from adding any of the above to your Touch Bar; simply add a "Shell Script/Task Widget" and use the following script with your own designated refresh rate:

/usr/local/bin/python3 -c "import tocco; print(tocco.battery.hours_left)"

Like so:

Simple as that. Your widget will now refresh with information every second! I recommend to be mindful of the refresh rate and only put low refresh time in utilities that are worthy (CPU percent, memory usage, etc) -- stuff like battery percent does not need a 1 second refresh rate.

Looks good, thanks for sharing. I like the simplicity of your TB, how did you change your escape key?

I can't seem to find the post where the esc key was posted, but here is the code for it:

[
  {
    "BTTTouchBarButtonName" : "esc",
    "BTTTriggerType" : 629,
    "BTTTriggerTypeDescription" : "Touch Bar button",
    "BTTTriggerClass" : "BTTTriggerTypeTouchBar",
    "BTTPredefinedActionType" : 189,
    "BTTPredefinedActionName" : "ESC (Escape Key, respects pressed modifiers)",
    "BTTEnabled2" : 1,
    "BTTUUID" : "6941B05D-9AF4-4D5F-8914-266333FCDEF8",
    "BTTNotesInsteadOfDescription" : 1,
    "BTTNotes" : "Escape Button",
    "BTTEnabled" : 1,
    "BTTModifierMode" : 0,
    "BTTOrder" : 1,
    "BTTDisplayOrder" : -2,
    "BTTMergeIntoTouchBarGroups" : 1,
    "BTTIconData" : "iVBORw0KGgoAAAANSUhEUgAAAMgAAAB4CAYAAAC3kr3rAAAMSWlDQ1BJQ0MgUHJvZmlsZQAASImVVwdUU8kanltSSWiBCEgJvYlSpEsJoUUQkCrYCEkgocSYEETsyrIKrl1EwIauiii6FkDWirrWRbG7lhdlUVlZFws2VN6kgK573nvn\/efM3C\/\/\/PP9JXPnzgCgV8uTSvNRfQAKJIWyxKgw1oT0DBapEyDABNCBGfDn8eVSdkJCLIAy+Py7vLkJraFcc1Nx\/XP8v4qBQCjnA4AkQJwlkPMLID4IAF7Kl8oKASD6Qb3tjEKpCk+C2EgGA4RYqsI5GlyqwlkaXKW2SU7kQLwbADKNx5PlAKDbAvWsIn4O5NG9DbG7RCCWAKBHhjiYL+IJII6GeERBwTQVhnbAKesrnpy\/cWYNcfJ4OUNYk4tayOFiuTSfN\/P\/LMf\/loJ8xaAPB9hoIll0oipnWLfbedNiVJgGcY8kKy4eYkOI34kFanuIUapIEZ2isUfN+XIOrBlgQuwu4IXHQGwOcaQkPy5Wq8\/KFkdyIYYrBC0WF3KTtXMXC+URSVrOWtm0xPhBnC3jsLVzG3kytV+V\/WlFXgpby39bJOQO8r8uESWnaWLGqEXi1DiIdSFmyvOSYjQ2mF2JiBM3aCNTJKrit4M4QCiJCtPwY1OyZZGJWntZgXwwX2yxSMyN0+LqQlFytJZnN5+njt8E4hahhJ0yyCOUT4gdzEUgDI\/Q5I5dE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ius" : 7,
      "BTTTouchBarFreeSpaceAfterButton" : 0,
      "BTTTouchBarBringPlayerToFront" : 0,
      "BTTTouchBarButtonColor" : "0.000000, 0.000000, 0.000000, 255.000000",
      "BTTTouchBarEmojiHideBackButton" : false,
      "BTTTouchBarItemPlacement" : 1,
      "BTTTouchBarAlwaysShowButton" : true,
      "BTTTouchBarHideWhenPaused" : 0,
      "BTTTouchBarButtonWidth" : 100,
      "BTTTouchBarItemIconHeight" : 30,
      "BTTTouchBarBatteryHideOnCharging" : false,
      "BTTTouchBarButtonTextAlignment" : 0,
      "BTTTouchBarAlternateBackgroundColor" : "0.000000, 0.000000, 0.000000, 0.000000",
      "BTTTBWidgetWidth" : 400,
      "BTTTouchBarDefaultPlayer" : 0,
      "BTTTouchBarItemIconWidth" : 50,
      "BTTTouchBarLongPressActionName" : "Close Menu",
      "BTTTouchBarButtonName" : "esc",
      "BTTTouchBarHideWhenNoPlayer" : false,
      "BTTTouchBarFontColor" : "255.000000, 255.000000, 255.000000, 255.000000",
      "BTTTouchBarButtonFontSize" : 15,
      "BTTTouchBarHideCover" : 0,
      "BTTTouchBarOnlyShowIcon" : true,
      "BTTTouchBarItemPadding" : -24
    }
  }
]

Just copy all of the above, and do Command + V on BetterTouchTool. Should paste the button.

1 Like

can you put a link to your preset pls?

someone please help - this isn't working for me, it just shows the widget, but not writing

when I run the script in BTT I get this

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.9/site-packages/tocco/__init__.py", line 1, in <module>
    from tocco.info import *
  File "/usr/local/lib/python3.9/site-packages/tocco/info.py", line 254, in <module>
    class cpu(object):
  File "/usr/local/lib/python3.9/site-packages/tocco/info.py", line 266, in cpu
    class temperature(object):
  File "/usr/local/lib/python3.9/site-packages/tocco/info.py", line 276, in temperature
    runcommand(
  File "/usr/local/lib/python3.9/site-packages/tocco/info.py", line 44, in runcommand
    p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
  File "/usr/local/Cellar/python@3.9/3.9.0_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 947, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/python@3.9/3.9.0_2/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1819, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/istats'