[][src]Struct rust_bitbar::Line

pub struct Line { /* fields omitted */ }

Line holds the content, styling and behaviour of a line in a Bitbar menu, both in the menu and submenus

Methods

impl Line[src]

pub fn style(&mut self, style: Style) -> &mut Self[src]

Style provides a alternate method for setting the text style related options.

pub fn command(&mut self, cmd: Cmd) -> &mut Self[src]

command provides a alternate method for setting the bash script and params along with some related flags via a Cmd struct.

pub fn href(&mut self, href: String) -> &mut Self[src]

href adds a URL to the line and makes it clickable.

pub fn color(&mut self, color: String) -> &mut Self[src]

Color sets the lines font color, can take a name or hex value.

pub fn font(&mut self, font: String) -> &mut Self[src]

Font sets the lines font.

pub fn size(&mut self, size: i64) -> &mut Self[src]

Size sets the lines font size.

pub fn bash(&mut self, bash: String) -> &mut Self[src]

Bash makes makes the line clickable and adds a script that will be run on click.

pub fn params(&mut self, params: Vec<String>) -> &mut Self[src]

Params adds arguments which are passed to the script specified by line.bash()

pub fn terminal(&mut self, terminal: bool) -> &mut Self[src]

Terminal sets a flag which controls whether a Terminal is opened when the bash script is run.

pub fn refresh(&mut self, refresh: bool) -> &mut Self[src]

Refresh controls whether clicking the line results in the plugin being refreshed. If the line has a bash script attached then the plugin is refreshed after the script finishes.

pub fn drop_down(&mut self, drop_down: bool) -> &mut Self[src]

DropDown sets a flag which controls whether the line only appears and cycles in the status bar but not in the dropdown.

pub fn length(&mut self, length: i64) -> &mut Self[src]

Length truncates the line after the specified number of characters. An elipsis will be added to any truncated strings, as well as a tooltip displaying the full string.

pub fn trim(&mut self, trim: bool) -> &mut Self[src]

Trim sets a flag to control whether leading/trailing whitespace is trimmed from the title. Defaults to true.

pub fn alternate(&mut self, alternate: bool) -> &mut Self[src]

Alternate sets a flag to mark a line as an alternate to the previous one for when the Option key is pressed in the dropdown.

pub fn emojize(&mut self, emojize: bool) -> &mut Self[src]

Emojize sets a flag to control parsing of github style :mushroom: into 🍄.

pub fn ansi(&mut self, ansi: bool) -> &mut Self[src]

Ansi sets a flag to control parsing of ANSI codes.

Trait Implementations

impl Clone for Line[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl ToString for Line[src]

impl Default for Line[src]

impl Debug for Line[src]

Auto Trait Implementations

impl Send for Line

impl Sync for Line

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]