[][src]Struct penrose::core::config::ConfigBuilder

pub struct ConfigBuilder { /* fields omitted */ }

Builder struct for generating user Config

Example

use penrose::core::{config::Config, layout::{LayoutConf, Layout, side_stack, monocle}};

fn my_layouts() -> Vec<Layout> {
    let mono_conf = LayoutConf {
        follow_focus: true,
        gapless: true,
        ..Default::default()
    };
    let n_main = 1;
    let ratio = 0.6;

    vec![
        Layout::new("[side]", LayoutConf::default(), side_stack, n_main, ratio),
        Layout::new("[mono]", mono_conf, monocle, n_main, ratio),
    ]
}

let mut config_builder = Config::default().builder();
let config = config_builder
    .floating_classes(vec!["rofi", "dmenu", "dunst", "pinentry-gtk-2"])
    .layouts(my_layouts())
    .border_px(4)
    .focused_border(0xebdbb2)
    .build()
    .expect("failed to build config");

Implementations

impl ConfigBuilder[src]

pub fn build(&self) -> Result<Config, String>[src]

Validate and build the underlying struct

pub fn workspaces(
    &mut self,
    val: impl IntoIterator<Item = impl Into<String>>
) -> &mut ConfigBuilder
[src]

Set the value of the initial available workspaces.

Constraints

You must provide at least one workspace per screen

pub fn floating_classes(
    &mut self,
    val: impl IntoIterator<Item = impl Into<String>>
) -> &mut ConfigBuilder
[src]

Set the value of the window classes that will always be considered floating

pub fn layouts(&mut self, val: Vec<Layout>) -> &mut ConfigBuilder[src]

Set the value of the Layout functions to be used by each Workspace

Constraints

You must provide at least one layout function

pub fn focused_border(&mut self, val: u32) -> &mut ConfigBuilder[src]

Set the value of the focused border color as a hex literal

pub fn unfocused_border(&mut self, val: u32) -> &mut ConfigBuilder[src]

Set the value of the unfocused border color as a hex literal

pub fn border_px(&mut self, val: u32) -> &mut ConfigBuilder[src]

Set the value of the border width of each window in pixels

pub fn gap_px(&mut self, val: u32) -> &mut ConfigBuilder[src]

Set the value of the gap between tiled windows in pixels

pub fn main_ratio_step(&mut self, val: f32) -> &mut ConfigBuilder[src]

Set the value of the percentage of the screen to grow the main region by when incrementing

pub fn show_bar(&mut self, val: bool) -> &mut ConfigBuilder[src]

Set the value of whether or not space should be reserved for a status bar

pub fn top_bar(&mut self, val: bool) -> &mut ConfigBuilder[src]

Set the value of whether or not the reserved space for a status bar is at the top of the sceen

pub fn bar_height(&mut self, val: u32) -> &mut ConfigBuilder[src]

Set the value of the height of the space to be reserved for a status bar in pixels

Trait Implementations

impl Debug for ConfigBuilder[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.