Home Documentation Blog Login
Home Documentation Blog Privacy Terms

macOS and Blood Glucose in the Menu Bar

Display your current glucose level and trend direction directly in your Mac's menu bar

Your glucose level always on screen How can you display your current blood glucose level in the macOS menu bar using xbar, Nightscout, and a short Python script? You only need three components to set it up: Nightscout xbar a Python script (already prepared!) Once configured, the reading updates automatically and stays visible while you work on your computer. The menu bar should show everything I need: the current reading, the direction of change, and whether my glucose level is within the configured range. xbar - data in the macOS menu bar xbar, previously known as BitBar, is a free macOS application. It can display the output of any script in the menu bar. This is the best place to start - download it from the website and install it on your Mac. The script can be written in: Python, Ruby, Bash, JavaScript, any other language that can run from the terminal. The principle is simple. xbar interprets the text printed by the script to standard output and displays it in the menu bar. Ready-made solution The script is already available in the official xbar-plugins repository: https://github.com/matryer/xbar-plugins/blob/main/Lifestyle/nightscout_monitor.1m.py Step-by-step configuration 1. Install xbar You can install xbar from the project's website - https://xbarapp.com/ Launch the application after installation. xbar will create a directory for plugins. By default, it is located here: ~/Library/Application Support/xbar/plugins/ You can also check the directory location in the application settings. 2. Prepare your Nightscout address For an instance created with diab.ninja, the API address will look similar to this: https://twoja-nazwa.diab.ninja/api/v1 Paste it into the following variable: BASE = "https://twoja-nazwa.diab.ninja/api/v1" When the instance requires authentication, create a token in the Nightscout administration tools and assign it to: API_TOKEN = "twoj-token" 3. Install the requests library The script requires the requests package. python3 -m pip install requests When using pyenv , check the active environment first: pyenv which python The library must be installed for the same interpreter specified in the first line of the script. 4. Save the script in the plugins directory Save the file in the xbar directory under the following name: glucose.5m.py This filename sets the refresh interval to five minutes. You can find the full article with a technical explanation here: https://medium.com/@diabninja/your-glucose-level-always-in-sight-192a04f9ec43 This small improvement is genuinely useful in everyday life. Your glucose level stays visible, and checking the trend does not interrupt your work or force you to reach for your phone.

Last updated: 13 July 2026