make bemenu case insensitive
This commit is contained in:
parent
f3281d7ae3
commit
8ab8628856
1 changed files with 5 additions and 4 deletions
|
@ -13,7 +13,7 @@ struct Link {
|
|||
fn main() -> std::io::Result<()> {
|
||||
let path = env::args()
|
||||
.nth(1)
|
||||
.expect("❌ Usage: select_bookmark <input.md>");
|
||||
.expect("Usage: select_bookmark <input.md>");
|
||||
let markdown = fs::read_to_string(path)?;
|
||||
let parser = Parser::new(&markdown);
|
||||
|
||||
|
@ -78,11 +78,12 @@ fn main() -> std::io::Result<()> {
|
|||
.collect();
|
||||
|
||||
if entries.is_empty() {
|
||||
println!("ℹ️ No links found.");
|
||||
println!("No links found");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
let mut child = Command::new("bemenu")
|
||||
.arg("-i")
|
||||
.stdin(Stdio::piped())
|
||||
.stdout(Stdio::piped())
|
||||
.spawn()
|
||||
|
@ -99,10 +100,10 @@ fn main() -> std::io::Result<()> {
|
|||
let selected = String::from_utf8_lossy(&output.stdout).trim().to_owned();
|
||||
|
||||
if let Some((_, url)) = entries.iter().find(|(label, _)| label == &selected) {
|
||||
println!("🌐 Opening: {}", url);
|
||||
println!("Opening: {}", url);
|
||||
open::that(url)?;
|
||||
} else {
|
||||
println!("❌ Selection not found or canceled.");
|
||||
println!("Selection not found or canceled");
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue