pub struct HyprlandConfig {
pub content: Vec<String>,
pub sections: HashMap<String, (usize, usize)>,
pub sourced_content: Vec<Vec<String>>,
pub sourced_sections: HashMap<String, (usize, usize)>,
pub sourced_paths: Vec<String>,
}Expand description
Core structure of the config
Fields§
§content: Vec<String>§sections: HashMap<String, (usize, usize)>§sourced_content: Vec<Vec<String>>§sourced_sections: HashMap<String, (usize, usize)>§sourced_paths: Vec<String>Implementations§
Source§impl HyprlandConfig
impl HyprlandConfig
pub fn new() -> Self
Sourcepub fn add_entry(&mut self, category: &str, entry: &str)
pub fn add_entry(&mut self, category: &str, entry: &str)
Add an entry to a mutable HyprlandConfig
Sourcepub fn add_entry_headless(&mut self, key: &str, value: &str)
pub fn add_entry_headless(&mut self, key: &str, value: &str)
Add a headless entry to a mutable HyprlandConfig
Example of a headless entry in Hyprland’s configuration:
windowrulev2 = float,class:^(hyprutils.hyprwall)$Sourcepub fn add_sourced(&mut self, config: Vec<String>)
pub fn add_sourced(&mut self, config: Vec<String>)
Add a sourced config file
Sourcepub fn parse_color(&self, color_str: &str) -> Option<(f32, f32, f32, f32)>
pub fn parse_color(&self, color_str: &str) -> Option<(f32, f32, f32, f32)>
Parse a color from Hyprland’s config into float RGBA values
Examples:
ⓘ
let config = HyprlandConfig::new();
let rgba = config.parse_color("rgba(1E4632FF)");
let rgb = config.parse_color("rgb(1E4632)");
let argb = config.parse_color("0xFF1E4632");
let expected = Some((0.11764706, 0.27450982, 0.19607843, 1.0));
assert_eq!(expected, rgba);
assert_eq!(expected, rgb);
assert_eq!(expected, argb);Trait Implementations§
Source§impl Debug for HyprlandConfig
impl Debug for HyprlandConfig
Source§impl Default for HyprlandConfig
impl Default for HyprlandConfig
Source§fn default() -> HyprlandConfig
fn default() -> HyprlandConfig
Returns the “default value” for a type. Read more
Source§impl Display for HyprlandConfig
impl Display for HyprlandConfig
Source§impl PartialEq for HyprlandConfig
impl PartialEq for HyprlandConfig
Auto Trait Implementations§
impl Freeze for HyprlandConfig
impl RefUnwindSafe for HyprlandConfig
impl Send for HyprlandConfig
impl Sync for HyprlandConfig
impl Unpin for HyprlandConfig
impl UnwindSafe for HyprlandConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more