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 337ad54 commit 30d630a
Showing 1 changed file with 22 additions and 6 deletions.
28 changes: 22 additions & 6 deletions overlays/pkgs/sway-helper/src/helpers/sway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,29 @@ pub(crate) fn get_containers_fzf_strings<'a>(
if (node.node_type == NodeType::Con || node.node_type == NodeType::FloatingCon)
&& node.nodes.is_empty()
{
strings.push(format!(
"[{}] [{}] {} (id={})",
parent_workspace.as_ref().unwrap().name.as_ref().unwrap(),
node.app_id.as_ref().unwrap(),
node.name.as_ref().unwrap(),
node.id
let mut s = String::new();

if let Some(ws) = &parent_workspace {
if let Some(name) = &ws.name {
s.push_str(&format!("[{name}] "));
}
}

if let Some(app_id) = &node.app_id {
s.push_str(&format!("[{app_id}] "));
}

s.push_str(&format!(
"{} ",
match &node.name {
Some(name) => name,
None => "<no name>",
}
));

s.push_str(&format!("(id={})", node.id));

strings.push(s);
}

for child in node.nodes.iter() {
Expand Down

0 comments on commit 30d630a

Please sign in to comment.