barbly: Create status bar menus for macOS from executables

[ bsd3, program, system ] [ Propose Tags ] [ Report a vulnerability ]

Allows you to place the stdout of a process in the macOS status bar.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies aeson, async, attoparsec, base (>=4 && <5), bytestring, mtl, optparse-applicative, shh (>=0.7.0.2), text [details]
License BSD-3-Clause
Copyright (c) 2019 Luke Clifton
Author Luke Clifton
Maintainer lukec@themk.net
Revised Revision 1 made by lukec at 2020-11-23T01:18:40Z
Category System
Bug tracker https://github.com/luke-clifton/barbly
Source repo head: git clone https://github.com/luke-clifton/barbly.git
Uploaded by lukec at 2019-08-16T00:51:05Z
Distributions NixOS:0.1.0.0
Executables barbly
Downloads 521 total (2 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2019-08-16 [all 2 reports]

Readme for barbly-0.1.0.0

[back to package description]

Barbly

Barbly allows you to create status bar menus for macOS. It's similar to bitbar and supports some of the same syntax.

Each instance of a barbly executable creates only one menu item. You specify the period at which to refresh, and the command to generate the menu contents.

Sample Scripts

Some sample scripts that are useful to use with barbly can be found in the scripts directory.

Here is an example of running the github_issues.sh script with barbly to monitor for new issues.

barbly -p 60 ./scripts/github_issues.sh nixos nixpkgs

Example Menu

Clicking on an item will open the issue in your browser.

Syntax

Barbly can decode either JSON objects or BitBar syntax for the script outputs. By default, it will attempt to auto-detect the format, but you can explicitly tell it which format to use with the --json and --bitbar flags.

JSON

The top level object has two fields, title, which is a string that will be displayed in the status bar, and items which is an array of menu items that will be displayed in the drop down menu when the title is clicked.

Each menu item is either {}, which creates a menu separator, or an object with a label field, which will be the text for that menu item. Optionally a menu item can have either an exec or a items field. An items field would contain an array of menu items and would create a sub-menu. An exec field would create a clickable menu item which executes the command described by the array of strings in the exec field.

{
  "title": "Example",
  "items": [
    {
      "label": "Say Hello",
      "exec": [ "say", "Hello" ]
    },
    {},
    {
      "label": "Sub Menu",
      "items": [
        {
          "label": "DuckDuckGo",
          "exec": [ "open", "https://duckduckgo.com/" ]
        }
      ]
    },
    { "label": "Information Only" }
  ]
}

BitBar

The bitbar simulation is not complete. Only the following features are supported.

The text that appears in the status bar is the output of the script up until a line containing only ---.

After this, each line represents an item in a drop down menu. Submenus can be nested arbitrarily by prefixing the line with -- (one pair for each level of nesting).

Each line can contain some paramters which appear after the first | as key value pairs separated by an =.

Paramter Name Effect Example
href Open the given URL or file. href=https://www.google.com
href=/Applications/Firefox.app
bash Run the given bash script bash=/my/script.bash
paramX Arguments to pass to the bash script above bash=/script.sh param1=5 param2=example

Menu separators can be created with lines containing only ---.

See the scripts in the scripts directory for some examples.