Got icons working baybeee
This commit is contained in:
parent
919e6a44f6
commit
76bb34391e
10
Makefile
10
Makefile
@ -157,3 +157,13 @@ docs: ## Build and open documentation
|
|||||||
tools: ## Install useful development tools
|
tools: ## Install useful development tools
|
||||||
cargo install cargo-watch cargo-audit cargo-machete cargo-flamegraph cargo-deb cargo-outdated
|
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,
|
size: &str,
|
||||||
icon_theme: &IconTheme,
|
icon_theme: &IconTheme,
|
||||||
) -> Option<std::path::PathBuf> {
|
) -> Option<std::path::PathBuf> {
|
||||||
println!("Icon: {}", icon_name);
|
|
||||||
let cache_key = format!("icon:{}:{}", icon_name, size);
|
let cache_key = format!("icon:{}:{}", icon_name, size);
|
||||||
let cache = waycast_core::cache::get();
|
let cache = waycast_core::cache::get();
|
||||||
|
|
||||||
@ -488,6 +487,11 @@ fn search_for_icon(
|
|||||||
size: &str,
|
size: &str,
|
||||||
icon_theme: &IconTheme,
|
icon_theme: &IconTheme,
|
||||||
) -> Option<std::path::PathBuf> {
|
) -> 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
|
let pixmap_paths: Vec<PathBuf> = icon_theme
|
||||||
.search_path()
|
.search_path()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -229,7 +229,9 @@ fn detect_project_type(path: &str) -> Option<String> {
|
|||||||
} else {
|
} else {
|
||||||
let langs = TOKEI_SCANNER.scan(path, Some(1));
|
let langs = TOKEI_SCANNER.scan(path, Some(1));
|
||||||
if let Some(l) = langs.first() {
|
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