Skip to main content

A python utility for creating xbar menus.

Project description

pyxbarr

PyPI PyPI - Downloads

pyxbarr is a Python library for helping you create python plugins for xbar with ease!

The library wraps all the xbar menu creation logic with classes and objects to let you create a plugin with a few lines of code and without dealing with string formatting complications.

Installation

Use the package manager pip to install foobar.

pip install pyxbarr

Usage

import pyxbarr

# Create a new xbar plugin
plugin = pyxbarr.Plugin(
    # Set the title of the plugin
    title=pyxbarr.Item("My Plugin", font="Menlo", size=20),
    # Add items to the plugin
    items=[
        pyxbarr.Item("Hello", color="blue", href="https://github.com/gohadar/pyxbarr")
    ]
).add_items(
    # Add multiple items to the plugin
    [
        pyxbarr.Item("World", color="red", key="shift+k"),
        pyxbarr.Item("Foo", color="green", alternative=pyxbarr.Item("Bar", color="yellow")),
        # Add item with submenu
        pyxbarr.Item("Baz", color="purple", children=[
            pyxbarr.Item("Qux"),
            pyxbarr.Item("Quux"),
        ]),
    ]
)

print(plugin)

Contributing

Please open an issue first to discuss what you would like to change. I welcome any and all criticism, feedback, and suggestions even if I may not agree.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyxbarr-0.0.2.tar.gz (12.0 kB view hashes)

Uploaded Source

Built Distribution

pyxbarr-0.0.2-py3-none-any.whl (19.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page