[−][src]Crate bitbar
This is bitbar
, a library crate which includes helpers for writing BitBar plugins in Rust. The main feature is the Menu
type whose Display
implementation generates output that conforms to the BitBar plugin API.
Features
The following features can be enabled via Cargo:
base64
: Adds a depencency to thebase64
crate and implements conversion methods from PNG files that aren't already base64-encoded toImage
s.css-colors
: Adds a dependency to thecss-colors
crate and implementsIntoColor
for its color typesRGB
,RGBA
,HSL
, andHSLA
.image
: Adds a depencency to theimage
crate. If thebase64
feature is also enabled, implementsTryFrom<DynamicImage>
forImage
.serenity
: Adds a dependency to theserenity
crate and implementsIntoColor
for itsColour
type.url1
: Adds a dependency to the outdated version 1 of theurl
crate and implementsIntoUrl
for itsUrl
type.
Example
use bitbar::{Menu, MenuItem}; fn main() { print!("{}", Menu(vec![ MenuItem::new("Title"), MenuItem::Sep, MenuItem::new("Menu Item") ])); }
Structs
Command | Used by |
ContentItem | A menu item that's not a separator. |
Image | Used by |
Menu | A BitBar menu. |
Enums
Extra | A menu item's alternate mode or submenu. |
MenuItem | A menu item can either be a separator or a content item. |
Params | BitBar only supports up to five parameters for |
Traits
IntoColor | Used by |
IntoUrl | Used by |
Attribute Macros
command | Registers a subcommand that you can run from a menu item's |
main | Annotate your |