Struct leechbar::BarBuilder [] [src]

pub struct BarBuilder { /* fields omitted */ }

The bar configuration.

This is used to configure the bar. After configuration, the bar can be created using the spawn method.

Examples

Basic usage:

use leechbar::{BarBuilder, Color};

// All method calls that take parameters are optional
BarBuilder::new()
    .background_color(Color::new(255, 0, 255, 255))
    .foreground_color(Color::new(0, 255, 0, 255))
    .font("Fira Mono Medium 14")
    .output("DVI-1")
    .name("MyBar")
    .height(30)
    .spawn()
    .unwrap();

Methods

impl BarBuilder
[src]

[src]

Create a new instance of the BarBuilder with default parameters.

[src]

Change the default foreground color.

Default: White (255, 255, 255, 255)

[src]

Change the default background color.

Default: Black (0, 0, 0, 255)

[src]

Change the default background image.

This takes an image and sets it as the default background for the bar. The image is not resized or modified in any way, so it is required to manually adjust it to fit the specified bar geometry.

Default: No background image.

[src]

Change the default name of the bar.

This name is used by your Window Manager.

Default: leechbar

[src]

Change the default font of the bar.

This font is used for each block unless manually overwritten.

Default: Default pango font.

[src]

Change the default height of the bar.

This specifies the vertical height used in pixels.

Default: 30

[src]

Change the default output the bar should be displayed on.

This uses RANDR to get the output with the specified name. An example value for a DVI output would be DVI-0.

If not specified the primary output is selected.

Default: Primary output.

[src]

Change the default vertical text offset of the bar.

This is overridden by the component's vertical offset if present.

Default: 0

[src]

Spawn the bar with the currently configured settings.

This creates a window and registers it as a bar on Xorg.

Trait Implementations

impl Default for BarBuilder
[src]

[src]

Returns the "default value" for a type. Read more