How to use the bitbar.sep function in bitbar

To help you get started, we’ve selected a few bitbar examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matryer / bitbar-plugins / Tools / PagerDuty / pagerDutyIncidents.30s.js View on Github external
/* jshint esversion: 6 */
'use strict';
const fetch = require('node-fetch');
const ta = require('time-ago')();
const bitbar = require('bitbar');

const cfg = require('home-config').load('.bitbarrc');

if (!cfg.pagerdutyincidents['api.endpoint'] || !cfg.pagerdutyincidents['api.token']) {
  const json = [];

  json.push({
    text: 'Config Needed',
    dropdown: false,
  },
  bitbar.sep, {
    text: 'Add to your .bitbarrc config file on your',
  }, {
    text: 'home directory the following information:',
  },
  bitbar.sep, {
    text: '[pagerdutyincidents]',
  }, {
    text: 'api.endpoint=https://',
  }, {
    text: 'api.token={your-token}',
  });

  bitbar(json);
  process.exit();
}
github robertbenjamin / bit-bus / index.js View on Github external
let newTrip = {};

        newTrip.scheduledArrival = moment(trip.scheduledArrivalTime).fromNow();
        if (trip.predictedArrivalTime) newTrip.predictedArrival = moment(trip.predictedArrivalTime).fromNow();

        return newTrip;
      });

    let menu = [];

    menu.push({
      text: `:bus: ${myTrips[0].predictedArrival || myTrips[0].scheduledArrival}`,
      color: myTrips[0].predictedArrival ? menuColor : warningColor
    });

    menu.push(bitbar.sep);

    myTrips.slice(1).forEach(trip => {
      menu.push({
        text: `:point_right: ${trip.predictedArrival || trip.scheduledArrival}`,
        color: trip.predictedArrival ? menuColor : warningColor
      })
    });

    bitbar(menu);
  }
});
github matryer / bitbar-plugins / Tools / PagerDuty / pagerDutyIncidents.30s.js View on Github external
color: config.colors.regularText,
        }, {
          text: `Urgency\t\t: ${incident.urgency}`,
          color: config.colors.regularText,
        }, {
          text: `Escalations\t: ${incident.number_of_escalations}`,
          color: config.colors.regularText,
        });
      });

      json.push({
        text: `${serviceIncidents[prop].name} (${serviceIncidents[prop].incidents.length})`,
        href: serviceIncidents[prop].html_url,
        submenu: incidents,
      },
      bitbar.sep);
    });
  } else {
github matryer / bitbar-plugins / Tools / PagerDuty / pagerDutyIncidents.30s.js View on Github external
.then((obj) => {
  const json = [];
  const serviceIncidents = obj.serviceIncidents;

  json.push({
    text: `[${obj.total}]`,
    dropdown: false,
    templateImage: config.icon.inactive,
    size: 8,
  },
  bitbar.sep);

  if (Object.keys(serviceIncidents).length) {
    Object.keys(serviceIncidents).forEach((prop) => {
      const incidents = [];

      serviceIncidents[prop].incidents.forEach((incident) => {
        const assignedTo = [];

        incident.assigned_to.forEach((user) => {
          assignedTo.push({
            text: `${user.object.name}, ${ta.ago(new Date(Date.parse(user.at)))}`,
            href: user.object.html_url,
            color: config.colors.regularText,
          }, {
            text: user.object.email,
            alternate: true,

bitbar

Simplifies BitBar app plugin creation

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular bitbar functions