diff --git a/Makefile b/Makefile index 2d73930..c9f7dee 100644 --- a/Makefile +++ b/Makefile @@ -156,4 +156,14 @@ docs: ## Build and open documentation # Development tools installation tools: ## Install useful development tools cargo install cargo-watch cargo-audit cargo-machete cargo-flamegraph cargo-deb cargo-outdated - @echo "Development tools installed!" \ No newline at end of file + @echo "Development tools installed!" + +devicon-theme: + rm -rf ./devicons + mkdir -p ./devicons + devicon remix -t framework,language -o ./devicons --variant original --fallback plain + devicon get nixos -o ./devicons + devicon get bash -o ./devicons + devicon get ansible -o ./devicons + cp devicons/nixos.svg devicons/nix.svg + cp devicons/bash.svg devicons/shell.svg \ No newline at end of file diff --git a/waycast-gtk/src/ui/gtk/mod.rs b/waycast-gtk/src/ui/gtk/mod.rs index 0f3c607..47aa9da 100644 --- a/waycast-gtk/src/ui/gtk/mod.rs +++ b/waycast-gtk/src/ui/gtk/mod.rs @@ -468,7 +468,6 @@ fn find_icon_file( size: &str, icon_theme: &IconTheme, ) -> Option { - println!("Icon: {}", icon_name); let cache_key = format!("icon:{}:{}", icon_name, size); let cache = waycast_core::cache::get(); @@ -488,6 +487,11 @@ fn search_for_icon( size: &str, icon_theme: &IconTheme, ) -> Option { + // Before doing everything below, check if it's a path + if Path::new(icon_name).exists() { + return Some(PathBuf::from(icon_name)); + } + let pixmap_paths: Vec = icon_theme .search_path() .into_iter() diff --git a/waycast-plugins/src/projects/mod.rs b/waycast-plugins/src/projects/mod.rs index 9487030..f1982e7 100644 --- a/waycast-plugins/src/projects/mod.rs +++ b/waycast-plugins/src/projects/mod.rs @@ -229,7 +229,9 @@ fn detect_project_type(path: &str) -> Option { } else { let langs = TOKEI_SCANNER.scan(path, Some(1)); if let Some(l) = langs.first() { - return Some(l.name.to_owned()); + // We do some special replacements so it's easier to match + // with the icon file names + return Some(l.name.to_owned().replace("+", "plus").replace("#", "sharp")); } }