Skip to content

Tiny C program that formats your latest Nightscout BGL reading for use in your terminal prompt (a.k.a $PS1)

Notifications You must be signed in to change notification settings

shanselman/nightscout-ps1

 
 

Repository files navigation

nightscout-ps1

CircleCI AppVeyor

Tiny C program that formats your latest Nightscout BGL reading for use in your terminal prompt (a.k.a $PS1). It's written in C to be as fast as possible, since it gets executed every time the prompt is rendered, so latency is critical.

You will need to set up nightscout-ps1-daemon which is responsible for connecting to your Nightscout server and creating the INI file that this program reads.

The trend and target high/low values are also provided, so that you may render arrows and colors as desired:

Installation

Preferred installation is by downloading a pre-compiled binary for your platform:

If there is no binary for your platform, or you would simply like to install from source, invoke the make command:

# build the `nightscout-ps1` binary
$ git submodule update --init
$ make
$ ./out/Default/nightscout-ps1

# install to /usr/local by default, set PREFIX for a custom dir
$ make install

Configure your $PS1

Add this to your .bashrc file:

export PS1="\$(nightscout-ps1) $ "

Be sure to add further customizations to your $PS1 from there!

Windows

Looking for the Windows version that was mentioned on Scott Hanselman's blog? For now use version 1.1.4 here and those instructions will work.

About

Tiny C program that formats your latest Nightscout BGL reading for use in your terminal prompt (a.k.a $PS1)

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 74.9%
  • Python 12.0%
  • Makefile 8.9%
  • Shell 4.2%