Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
DanNixon committed Aug 19, 2024
1 parent 134ee25 commit dc0730d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions overlays/pkgs/sway-helper/src/commands/focus_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ fn list_containers<'a>(
containers: &mut Vec<ContainerDetails>,
) {
if node.node_type == NodeType::Workspace {
parent_workspace = Some(&node);
parent_workspace = Some(node);
}

if (node.node_type == NodeType::Con || node.node_type == NodeType::FloatingCon)
Expand All @@ -71,9 +71,9 @@ fn list_containers<'a>(
}

for child in node.nodes.iter() {
list_containers(&child, parent_workspace, containers);
list_containers(child, parent_workspace, containers);
}
for child in node.floating_nodes.iter() {
list_containers(&child, parent_workspace, containers);
list_containers(child, parent_workspace, containers);
}
}
2 changes: 1 addition & 1 deletion overlays/pkgs/sway-helper/src/commands/new_workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ fn list_workspaces(node: &Node, workspaces: &mut Vec<WorkspaceDetails>) {
}

for child in node.nodes.iter() {
list_workspaces(&child, workspaces);
list_workspaces(child, workspaces);
}
}
3 changes: 1 addition & 2 deletions overlays/pkgs/sway-helper/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl CliRun for Run {
}

fn is_executable(path: &Path) -> bool {
match std::fs::metadata(&path) {
match std::fs::metadata(path) {
Ok(meta) => (meta.st_mode() & 0o111) != 0,
Err(_) => false,
}
Expand All @@ -27,7 +27,6 @@ fn list_programs_from_path() -> Vec<String> {
std::env::var("PATH")
.expect("PATH environment variable should be set")
.split(':')
.into_iter()
.flat_map(|path| match std::fs::read_dir(path) {
Ok(entries) => Some(entries.into_iter().flat_map(|e| e.ok()).collect::<Vec<_>>()),
Err(_) => None,
Expand Down
2 changes: 1 addition & 1 deletion overlays/pkgs/sway-helper/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn main() {
],
);

let cli = Cli::try_parse_from(&["", &selection]).unwrap();
let cli = Cli::try_parse_from(["", &selection]).unwrap();

cli.command.unwrap().run(&mut sway);
}
Expand Down

0 comments on commit dc0730d

Please sign in to comment.