Giter Site home page Giter Site logo

nightscout-osx-menubar's Introduction

nightscout-osx-menubar

View CGM data from Nightscout in the OS X menu bar.

Latest version: 0.3.3

nightscout-osx-menubar screenshot

Requirements

  • OS X (tested with 10.8 and 10.10, may work with earlier versions)
  • A working installation of Nightscout (cgm-remote-monitor)

Installation

  1. Download this zip file containing the app and unzip it.
  2. Drag "Nightscout Menubar" into your "Applications" folder.
  3. Run it.
  4. (Optional) To run automatically on startup, go to System Preferences > Users & Groups > Login Items, and add Nightscout Menubar to the list.

Customization

For now, if you want to customize the display and are comfortable making small edits to a Python file, you can edit nightscout_osx_menubar.py within the app package.

In Finder, right-click on the app and click "Show Package Contents". Open Contents/Resources/nightscout_osx_menubar.py in a text editor. All the available configuration is at the top of the file.

For example:

  • Change HISTORY_LENGTH to control the number of history menu items
  • Change MENUBAR_TEXT to u"{sgv} {direction}" to shorten the menu bar text to only BG and a trend arrow
  • Change MENU_ITEM_TEXT to likewise change how the history items are formatted
  • Modify time_ago to return strings like "5m" instead of "5 min"
  • etc.

This is not a long-term solution since your modifications won't survive a reinstall of the app. A better configuration system is in the works.

Development

This uses rumps, which provides a nice interface to PyObjC to create simple menu bar apps, and py2app, a Python setuptools command which allows you to package Python scripts as standalone OS X applications.

To run the app in development:

git clone https://github.com/mddub/nightscout-osx-menubar
cd nightscout-osx-menubar
pip install -r requirements.txt --user  # This may take a while
python nightscout_osx_menubar.py

To build a standalone app in dist/:

python setup.py py2app

Troubleshooting

  • If an error occurs while running the standalone app, some additional information was probably logged to the Console app (in Applications > Utilities).

  • To view the app's output in the terminal and get extra debug information, start the app from the command line with the --debug flag:

    cd /Applications
    ./Nightscout\ Menubar.app/Contents/MacOS/Nightscout\ Menubar --debug
    

Notes

File an issue if you'd like to give feedback, request an enhancement, or report a bug. Pull requests are welcome.

Disclaimer

This project is intended for educational and informational purposes only. It is not FDA approved and should not be used to make medical decisions. It is neither affiliated with nor endorsed by Dexcom.

nightscout-osx-menubar's People

Contributors

jessiepusateri avatar mddub avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nightscout-osx-menubar's Issues

Requires manual refresh for new data?

Menubar correctly pulls in data on configuration, but doesn't automatically refresh. (Going to configure and hitting "ok" pulls in new data, though.)

Feature Request -- add a proxy config setting

Hey,
I Love Nightscout Menubar.

I work at a place that has the vast interwebs behind a proxy, so I was wondering how hard it would be to add a setting for the user to enter a proxy address, and to push HTTP requests through that proxy.

Thanks!

Add caching

Right now the app requests the 6 most recent SGVs every 20 seconds. It should instead cache them, and request only SGVs with a timestamp newer than the most recent one cached. Then it could also continue to display when there's a brief network problem.

Display units in mmol

Would be great if we could configure the app to use mmol as unit instead of mgdl.

Since Spike is offline can't get data through Tomato app

This is strange, I got my workaround: the NS website IS working!
The Tomato app seems to upload it to Nightscout.

But only the NS menubar can't get it from the Heroku server anymore? link hasn't changed and it supposed to get data through Nightscout anyway.. please explain why it cant get the data?

Many Thanks,
Jules

Protected data

How do you set an API key here? I have all my data protected with a key so only those with it can access the logs.

Thanks.

Support Tokens

Great little app! Thanks!
I modified nightscout_osx_menubar.py to have the token, since ours is a locked down site. Might be nice to add as an option in the program.

/api/v1/entries/sgv.json?count={count}&token=XXXXXXXXXXXXXXXX

"Fatal Error" on Monterey (no Python on Monterey, but even after installing Python, still error)

Nightscout Menubar has encountered a fatal error, and will now terminate.
A Python runtime not could be located. You may need to install a framework build of Python, or edit the PyRuntimeLocations array in this application's Info.plist file.

It seems that Python 2.7 and even Python 3 is not shipped / installed with macOS Monterey.

My solution attempt:

  1. Installed Python 2.7 from https://www.python.org/downloads/release/python-2718/ (macOS 64bit)
  2. Added to /Applications/Nightscout Menubar.app/Contents/Info.plist in section PyRuntimeLocations:
    /Library/Frameworks/Python.framework/Versions/2.7/bin/python

Then, in terminal:
3. rm /Applications/Nightscout Menubar.app/Contents/MacOS/python (which was symlinking to a wrong location of python: It's not installed in /usr/bin/python anymore, but in /usr/local/bin/python)
4. ln -s /usr/local/bin/python /Applications/Nightscout Menubar.app/Contents/MacOS/python

When I try to launch Nightscount Mebubar, it seems to go a little further, but still, I get a little dialog saing "Nightscount Menubar Error" with the buttons "Open Console" and "Terminate".

In Console (system log) I just see
Apr 24 01:01:25 MBP5 Nightscout Menubar[6316]: Nightscout Menubar Error

Now, I don't know what I could do anymore.

Not really an issue

is there any way i can modify the python to accept two Nightscout URL? I got two kids with T1. I love this app btw!!

Can't get it running on 10.12.6

If I double click on the app, nothing seems to happen. If I run it from the command line I get the following:
LSOpenURLsWithRole() failed for the application /Applications/Nightscout Menubar.app with error -10810.

Error code 10810 is pretty useless.

Console message is also useless.
Nov 14 12:16:45 Johns-MacProTwelve com.apple.xpc.launchd[1] (com.warkmilson.nightscout.menubar.39984[37191]): Service exited with abnormal code: 1

Somehow I got it running once (not sure what I did) but I thought it was a good app and would like to get it running regularly.

Thanks.

Battery

Hi! Can you add bridge battery information? in drop-down menu somewhere after history.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.