All Projects → SteveEdson → bitbar-php

SteveEdson / bitbar-php

Licence: MIT license
PHP formatter for BitBar plugins

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to bitbar-php

bitbar-dnscrypt-proxy-switcher
BitBar plugin to control dnscrypt-proxy usage
Stars: ✭ 147 (+126.15%)
Mutual labels:  bitbar, bitbar-plugin, bitbar-plugins
macOS-global-autocomplete
📃 System-wide autocompleting that learns what you type and works in any app! (also slightly scary maybe don't use this...)
Stars: ✭ 26 (-60%)
Mutual labels:  bitbar, bitbar-plugin
Yabai-Spaces
A *crazy* customizable Bitbar plugin that displays the total number of spaces and highlights the current one.
Stars: ✭ 33 (-49.23%)
Mutual labels:  bitbar
alpaca-desktop
Experimental OSX menu bar widget for Alpaca.
Stars: ✭ 18 (-72.31%)
Mutual labels:  bitbar
Xbar
Put the output from any script or program into your macOS Menu Bar (the BitBar reboot)
Stars: ✭ 15,693 (+24043.08%)
Mutual labels:  bitbar
Xbar Plugins
Plugin repository for xbar (the BitBar reboot)
Stars: ✭ 1,964 (+2921.54%)
Mutual labels:  bitbar
covid-19indiatracker
Track Covid-19 cases in India from MacOS menu bar
Stars: ✭ 24 (-63.08%)
Mutual labels:  bitbar
alfred-timer-workflow
Alfred workflow to start a timer, which blinks when the time is up.
Stars: ✭ 39 (-40%)
Mutual labels:  bitbar
Php Static Analysis Tools
A reviewed list of useful PHP static analysis tools
Stars: ✭ 2,551 (+3824.62%)
Mutual labels:  php-formatter
covid-19-bitbar-plugin
Bitbar plugin for covid-19 data.
Stars: ✭ 98 (+50.77%)
Mutual labels:  bitbar-plugin
bitbar-chunkwm skhd
A simple bitbar for chunkwm/skhd.
Stars: ✭ 22 (-66.15%)
Mutual labels:  bitbar-plugin

BitBar PHP Formatter

Latest Stable Version Total Downloads Latest Unstable Version License FOSSA Status

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:

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

or run $ composer require "steveedson/bitbar-php"

File Structure

You file structure inside your plugins directory, should look something like:

.
├── .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.

#!/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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].