Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed Aug 20, 2024
1 parent 0c4101c commit 6d7c92f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 6 deletions.
39 changes: 39 additions & 0 deletions overlays/pkgs/sway-helper/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions overlays/pkgs/sway-helper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ clap = { version = "4.5.16", features = ["derive"] }
colored = "2.1.0"
edit = "0.1.5"
fzf-wrapped = "0.1.4"
regex = "1.10.6"
swayipc = "3.0.2"
23 changes: 17 additions & 6 deletions overlays/pkgs/sway-helper/src/commands/combi.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::CliRun;
use crate::helpers::programs::list_programs_from_path;
use colored::Colorize;
use regex::Regex;

pub(crate) struct Combi {}

Expand Down Expand Up @@ -38,11 +39,21 @@ impl CliRun for Combi {
// Fuzzy select something.
let selected = crate::helpers::run_fzf("combi", options);

// TODO
let mut s = selected.splitn(2, ' ');
let a = s.next().unwrap();
println!("{a}");
let b = s.next().unwrap();
println!("{b}");
let re = Regex::new(r"\[(.+)\] (.+)$").unwrap();

let caps = re.captures(&selected).unwrap();
let (a, b) = (&caps[1], &caps[2]);

match a {
CMD => {
println!("do cmd");
println!("{b}");
},
RUN => {
println!("do run");
println!("{b}");
},
_ => panic!(),
}
}
}

0 comments on commit 6d7c92f

Please sign in to comment.