Icon installation in dev at least
This commit is contained in:
parent
4c1fa88d4a
commit
dc5ab759f2
9
Makefile
9
Makefile
@ -167,4 +167,11 @@ devicon-theme:
|
||||
devicon get bash -o $(DEVICON_DIR)
|
||||
devicon get ansible -o $(DEVICON_DIR)
|
||||
cp $(DEVICON_DIR)/nixos.svg $(DEVICON_DIR)/nix.svg
|
||||
cp $(DEVICON_DIR)/bash.svg $(DEVICON_DIR)/shell.svg
|
||||
cp $(DEVICON_DIR)/bash.svg $(DEVICON_DIR)/shell.svg
|
||||
|
||||
install-icons: ## Install icons to XDG data directory
|
||||
@XDG_DATA_HOME=$${XDG_DATA_HOME:-$$HOME/.local/share} && \
|
||||
ICON_DIR="$$XDG_DATA_HOME/waycast/icons" && \
|
||||
mkdir -p "$$ICON_DIR" && \
|
||||
cp -r ./assets/icons/* "$$ICON_DIR/" && \
|
||||
echo "Icons installed to $$ICON_DIR"
|
@ -36,8 +36,21 @@ impl LauncherListItem for ProjectEntry {
|
||||
description: Some(self.path.to_string_lossy().to_string()),
|
||||
icon: {
|
||||
if let Some(t) = &self.project_type {
|
||||
let icon_path = PathBuf::from("./devicons");
|
||||
return icon_path.join(format!("{}.svg", t.to_lowercase())).to_string_lossy().to_string();
|
||||
// Try XDG data directory first, fall back to development path
|
||||
let icon_name = format!("{}.svg", t.to_lowercase());
|
||||
|
||||
if let Some(data_dir) = waycast_config::data_dir() {
|
||||
let xdg_icon_path = data_dir.join("icons").join("devicons").join(&icon_name);
|
||||
if xdg_icon_path.exists() {
|
||||
return xdg_icon_path.to_string_lossy().to_string();
|
||||
}
|
||||
}
|
||||
|
||||
// Fall back to development path
|
||||
let dev_icon_path = PathBuf::from("./assets/icons/devicons").join(&icon_name);
|
||||
if dev_icon_path.exists() {
|
||||
return dev_icon_path.to_string_lossy().to_string();
|
||||
}
|
||||
}
|
||||
|
||||
String::from("vscode")
|
||||
|
Loading…
x
Reference in New Issue
Block a user