{"id":16952236,"url":"https://github.com/steveedson/bitbar-php","last_synced_at":"2025-10-14T01:07:48.614Z","repository":{"id":57059836,"uuid":"50188120","full_name":"SteveEdson/bitbar-php","owner":"SteveEdson","description":"PHP formatter for BitBar plugins","archived":false,"fork":false,"pushed_at":"2019-01-04T10:16:58.000Z","size":97,"stargazers_count":67,"open_issues_count":1,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-27T18:15:23.448Z","etag":null,"topics":["bitbar","bitbar-php","bitbar-plugin","bitbar-plugins","php-formatter"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SteveEdson.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-22T15:05:22.000Z","updated_at":"2024-05-09T08:03:12.000Z","dependencies_parsed_at":"2022-08-24T07:30:41.564Z","dependency_job_id":null,"html_url":"https://github.com/SteveEdson/bitbar-php","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/SteveEdson/bitbar-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveEdson%2Fbitbar-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveEdson%2Fbitbar-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveEdson%2Fbitbar-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveEdson%2Fbitbar-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SteveEdson","download_url":"https://codeload.github.com/SteveEdson/bitbar-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SteveEdson%2Fbitbar-php/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279017454,"owners_count":26086081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-13T02:00:06.723Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bitbar","bitbar-php","bitbar-plugin","bitbar-plugins","php-formatter"],"created_at":"2024-10-13T22:01:45.324Z","updated_at":"2025-10-14T01:07:48.598Z","avatar_url":"https://github.com/SteveEdson.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BitBar PHP Formatter\n\n[![Latest Stable Version](https://poser.pugx.org/steveedson/bitbar-php/v/stable)](https://packagist.org/packages/steveedson/bitbar-php) [![Total Downloads](https://poser.pugx.org/steveedson/bitbar-php/downloads)](https://packagist.org/packages/steveedson/bitbar-php) [![Latest Unstable Version](https://poser.pugx.org/steveedson/bitbar-php/v/unstable)](https://packagist.org/packages/steveedson/bitbar-php) [![License](https://poser.pugx.org/steveedson/bitbar-php/license)](https://packagist.org/packages/steveedson/bitbar-php)\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FSteveEdson%2Fbitbar-php.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2FSteveEdson%2Fbitbar-php?ref=badge_shield)\n\n## Installing\n\nCurrently, 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:\n\n\n```json\n{\n  \"require\": {\n    \"steveedson/bitbar-php\": \"dev-master\"\n  }\n}\n```\n\nor run `$ composer require \"steveedson/bitbar-php\"`\n\n### File Structure\n\nYou file structure inside your plugins directory, should look something like:\n\n```\n.\n├── .bitbar/\n│   ├── composer.json\n│   └── vendor/\n└── test.5m.php\n```\n\n## Usage\n\nIn your BitBar plugins directory, create a file, e.g. `test.5m.php`. Don't forget to add the shebang at the beginning.\n\n```php\n#!/usr/bin/php\n\n\u003c?php\n\nrequire \".bitbar/vendor/autoload.php\";\n\nuse SteveEdson\\BitBar;\n\n// Create BitBar formatter\n$bb = new BitBar();\n\n// Create the first line\n$line = $bb-\u003enewLine();\n\n// Set the text and formatting\n$line\n    -\u003esetText(\"Hello World\")\n    -\u003esetColour(\"yellow\")\n    -\u003esetUrl(\"https://steveedson.co.uk\")\n    -\u003eshow();\n```\n\n### Examples\n\n#### Using Sub Menus\n\n```php\n// Create BitBar formatter\n$bb = new BitBar();\n\n// Create the first line\n$line = $bb-\u003enewLine();\n\n// Set the text and formatting\n$mainMenu = $line\n    -\u003esetText(\"Servers\")\n    -\u003esetColour(\"yellow\");\n\n$mainMenu = $mainMenu-\u003eaddSubMenu()\n    -\u003enewLine()\n    -\u003esetText(\"Server 1\")\n    -\u003esetUrl('http://server1.com');\n\n$mainMenu = $mainMenu-\u003eaddSubMenu()\n    -\u003enewLine()\n    -\u003esetText(\"Server 2\")\n    -\u003esetUrl('http://server2.com');\n\n$mainMenu-\u003eshow();\n```\n\n\n## License\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FSteveEdson%2Fbitbar-php.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FSteveEdson%2Fbitbar-php?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteveedson%2Fbitbar-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteveedson%2Fbitbar-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteveedson%2Fbitbar-php/lists"}