2017 © Pedro Pelรกez
 

library bitbar-php

PHP Formatter for BitBar plugins

image

steveedson/bitbar-php

PHP Formatter for BitBar plugins

  • Tuesday, June 19, 2018
  • by SteveEdson
  • Repository
  • 2 Watchers
  • 43 Stars
  • 163 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 1 Open issues
  • 18 Versions
  • 19 % Grown

The README.md

BitBar PHP Formatter

Latest Stable Version Total Downloads Latest Unstable Version License FOSSA Status, (*1)

Installing

Currently, BitBar reads any file in your directory a plugin, and tries to execute it. To workaround this, create a hidden folder, beginning with a dot, for example .bitbar/. In this directory create or edit your composer.json to include the library:, (*2)

{
  "require": {
    "steveedson/bitbar-php": "dev-master"
  }
}

or run $ composer require "steveedson/bitbar-php", (*3)

File Structure

You file structure inside your plugins directory, should look something like:, (*4)

.
โ”œโ”€โ”€ .bitbar/
โ”‚ย ย  โ”œโ”€โ”€ composer.json
โ”‚ย ย  โ””โ”€โ”€ vendor/
โ””โ”€โ”€ test.5m.php

Usage

In your BitBar plugins directory, create a file, e.g. test.5m.php. Don't forget to add the shebang at the beginning., (*5)

#!/usr/bin/php

<?php

require ".bitbar/vendor/autoload.php";

use SteveEdson\BitBar;

// Create BitBar formatter
$bb = new BitBar();

// Create the first line
$line = $bb->newLine();

// Set the text and formatting
$line
    ->setText("Hello World")
    ->setColour("yellow")
    ->setUrl("https://steveedson.co.uk")
    ->show();

Examples

Using Sub Menus

// Create BitBar formatter
$bb = new BitBar();

// Create the first line
$line = $bb->newLine();

// Set the text and formatting
$mainMenu = $line
    ->setText("Servers")
    ->setColour("yellow");

$mainMenu = $mainMenu->addSubMenu()
    ->newLine()
    ->setText("Server 1")
    ->setUrl('http://server1.com');

$mainMenu = $mainMenu->addSubMenu()
    ->newLine()
    ->setText("Server 2")
    ->setUrl('http://server2.com');

$mainMenu->show();

License

FOSSA Status, (*6)

The Versions

19/06 2018

dev-feature/nested-submenus

dev-feature/nested-submenus

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

19/06 2018

dev-master

9999999-dev

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

19/06 2018

0.4.4

0.4.4.0

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

19/06 2018

0.4.3

0.4.3.0

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

19/06 2018

0.4.2

0.4.2.0

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

23/03 2016

0.4.1

0.4.1.0

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

23/03 2016

0.4.0

0.4.0.0

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

23/03 2016

0.3.1

0.3.1.0

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

23/03 2016

0.3.0

0.3.0.0

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

18/02 2016

0.2.0

0.2.0.0

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

05/02 2016

0.1.1

0.1.1.0

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

05/02 2016

0.1.0

0.1.0.0

PHP Formatter for BitBar plugins

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

22/01 2016

0.0.6

0.0.6.0

PHP Formatter for BitBar plugins

  Sources   Download

The Requires

  • php >=5.3.0

 

22/01 2016

0.0.5

0.0.5.0

PHP Formatter for BitBar plugins

  Sources   Download

The Requires

  • php >=5.3.0

 

22/01 2016

0.0.4

0.0.4.0

PHP Formatter for BitBar plugins

  Sources   Download

The Requires

  • php >=5.3.0

 

22/01 2016

0.0.3

0.0.3.0

PHP Formatter for BitBar plugins

  Sources   Download

The Requires

  • php >=5.3.0

 

22/01 2016

0.0.2

0.0.2.0

PHP Formatter for BitBar plugins

  Sources   Download

The Requires

  • php >=5.3.0

 

22/01 2016

0.0.1

0.0.1.0

PHP Formatter for BitBar plugins

  Sources   Download

The Requires

  • php >=5.3.0