Giter VIP home page Giter VIP logo

nightscout-ps1's Introduction

nightscout-ps1

Build Status

Syncs the latest two entries from Nightscout to a file the can be consumed by your command line prompt (a.k.a. $PS1).

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, you may install from the npm registry:

$ npm install -g nightscout-ps1

Usage

The flags for usage of nightscout-ps1 are listed here, however it is highly recommended that you set up the daemon as a "service" for your operating system.

$ nightscout-ps1 -n "my-nightscout-url.com" -c ~/.nightscout-ps1.env

Replace my-nightscout-url.com with the actual URL to your own Nightscout deployment.

Flag Description
--cache-file/-c Path to write the latest reading file.
Must end in .env or .json, and may be specified more than once.
Defaults to ~/.nightscout-ps1.env.
--nightscout/-n URL of your Nightscout deployment.

Setup on macOS

cp service/io.n8.nightscout-ps1.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/io.n8.nightscout-ps1.plist

Then see Configuring your PS1 below.

Setup on Linux

cp service/nightscout-ps1.service /etc/systemd/system/
sudo systemd start nightscout-ps1
sudo systemd enable nightscout-ps1

Then see Configuring your PS1 below.

Setup on Windows

Check out this blog post by Scott Hanselman to setup as a Windows Service:

Visualizing your real-time blood sugar values AND a Git Prompt on Windows PowerShell and Linux Bash

Configuring your PS1

First, install import.

Second, add the following to your .bashrc file:

. "$(which import)"
import "tootallnate/[email protected]"

export PS1="\$(nightscout_ps1) \$ "

Be sure to add further customizations to your PS1 to your liking!

Formats

The --cache-file/-c flag determines how to format the output file based on the file extension. These are the supported format types:

.env

Formatted with key=value pairs that may be source or eval'd in a shell script (i.e. your .bashrc file). Example.

.json

Formatted as a JSON file, which may consumed by jq or other related tools. Example.

nightscout-ps1's People

Contributors

tootallnate avatar dlongman avatar shanselman avatar

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.