Rofi Library for Rust

Spawn rofi windows, and parse the result appropriately.

Simple example

``` use rofi; use std::{fs, env};

let direntries = fs::readdir(env::current_dir().unwrap()) .unwrap() .map(|d| format!("{:?}", d.unwrap().path())) .collect::>();

match rofi::Rofi::new(&dir_entries).run() { Ok(choice) => println!("Choice: {}", choice), Err(rofi::Error::Interrupted) => println!("Interrupted"), Err(e) => println!("Error: {}", e) } ```

Example of returning an index

rofi can also be used to return an index of the selected item:

``` use rofi; use std::{fs, env};

let direntries = fs::readdir(env::current_dir().unwrap()) .unwrap() .map(|d| format!("{:?}", d.unwrap().path())) .collect::>();

match rofi::Rofi::new(&direntries).runindex() { Ok(element) => println!("Choice: {}", element), Err(rofi::Error::Interrupted) => println!("Interrupted"), Err(rofi::Error::NotFound) => println!("User input was not found"), Err(e) => println!("Error: {}", e) } ```