pub struct ConfigBuilder { /* private fields */ }
Expand description
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("#ebdbb2")
.unwrap()
.build()
.expect("failed to build config");
Implementations§
Source§impl ConfigBuilder
impl ConfigBuilder
Sourcepub fn workspaces<T, U>(&mut self, val: T) -> &mut ConfigBuilder
pub fn workspaces<T, U>(&mut self, val: T) -> &mut ConfigBuilder
Set the value of the initial available workspaces.
§Constraints
You must provide at least one workspace per screen
Sourcepub fn floating_classes<T, U>(&mut self, val: T) -> &mut ConfigBuilder
pub fn floating_classes<T, U>(&mut self, val: T) -> &mut ConfigBuilder
Set the value of the window classes that will always be considered floating
Sourcepub fn layouts(&mut self, val: Vec<Layout>) -> &mut ConfigBuilder
pub fn layouts(&mut self, val: Vec<Layout>) -> &mut ConfigBuilder
Sourcepub fn focused_border<T>(&mut self, val: T) -> Result<&mut ConfigBuilder>
pub fn focused_border<T>(&mut self, val: T) -> Result<&mut ConfigBuilder>
Set the value of the focused border color as a hex literal
Sourcepub fn unfocused_border<T>(&mut self, val: T) -> Result<&mut ConfigBuilder>
pub fn unfocused_border<T>(&mut self, val: T) -> Result<&mut ConfigBuilder>
Set the value of the unfocused border color as a hex literal
Sourcepub fn border_px(&mut self, val: u32) -> &mut ConfigBuilder
pub fn border_px(&mut self, val: u32) -> &mut ConfigBuilder
Set the value of the border width of each window in pixels
Sourcepub fn gap_px(&mut self, val: u32) -> &mut ConfigBuilder
pub fn gap_px(&mut self, val: u32) -> &mut ConfigBuilder
Set the value of the gap between tiled windows in pixels
Sourcepub fn main_ratio_step(&mut self, val: f32) -> &mut ConfigBuilder
pub fn main_ratio_step(&mut self, val: f32) -> &mut ConfigBuilder
Set the value of the percentage of the screen to grow the main region by when incrementing
Sourcepub fn show_bar(&mut self, val: bool) -> &mut ConfigBuilder
pub fn show_bar(&mut self, val: bool) -> &mut ConfigBuilder
Set the value of whether or not space should be reserved for a status bar
Sourcepub fn top_bar(&mut self, val: bool) -> &mut ConfigBuilder
pub fn top_bar(&mut self, val: bool) -> &mut ConfigBuilder
Set the value of whether or not the reserved space for a status bar is at the top of the sceen
Sourcepub fn bar_height(&mut self, val: u32) -> &mut ConfigBuilder
pub fn bar_height(&mut self, val: u32) -> &mut ConfigBuilder
Set the value of the height of the space to be reserved for a status bar in pixels