[−][src]Struct penrose::contrib::extensions::DMenu
A wrapper around the suckless dmenu program for creating dynamic menus in penrose.
Implementations
impl DMenu
[src]
pub fn new(
prompt: impl Into<String>,
choices: Vec<impl Into<String>>,
config: DMenuConfig
) -> Self
[src]
prompt: impl Into<String>,
choices: Vec<impl Into<String>>,
config: DMenuConfig
) -> Self
Create a new DMenu command which can be triggered and re-used by calling the run
method
pub fn run(&self, screen_index: usize) -> Result<MenuMatch>
[src]
Run this DMenu command and return the selected choice.
Example
let lines = vec!["some", "choices", "to", "pick", "from"]; let menu = DMenu::new(">>>", lines, DMenuConfig::default()); let screen_index = manager.active_screen_index(); match menu.run(screen_index)? { MenuMatch::Line(i, s) => println!("matched '{}' on line '{}'", s, i), MenuMatch::UserInput(s) => println!("user input: '{}'", s), MenuMatch::NoMatch => println!("no match"), }
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for DMenu
[src]
impl Send for DMenu
[src]
impl Sync for DMenu
[src]
impl Unpin for DMenu
[src]
impl UnwindSafe for DMenu
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,