Got icons working baybeee
This commit is contained in:
parent
919e6a44f6
commit
76bb34391e
12
Makefile
12
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!"
|
||||
@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
|
@ -468,7 +468,6 @@ fn find_icon_file(
|
||||
size: &str,
|
||||
icon_theme: &IconTheme,
|
||||
) -> Option<std::path::PathBuf> {
|
||||
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<std::path::PathBuf> {
|
||||
// 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<PathBuf> = icon_theme
|
||||
.search_path()
|
||||
.into_iter()
|
||||
|
@ -229,7 +229,9 @@ fn detect_project_type(path: &str) -> Option<String> {
|
||||
} 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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user