From 8fa00affda48e06a759915bf12e01a5ffca65e45 Mon Sep 17 00:00:00 2001 From: verdant Date: Mon, 3 Aug 2026 21:01:05 +0800 Subject: Add width character and icon support --- src/icon.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/icon.h (limited to 'src/icon.h') diff --git a/src/icon.h b/src/icon.h new file mode 100644 index 0000000..bf276c0 --- /dev/null +++ b/src/icon.h @@ -0,0 +1,27 @@ +#ifndef SF_ICON_H +#define SF_ICON_H + +#include + +#define DEFAULT_DIR_ICON "󰉋" +#define DEFAULT_FILE_ICON "󰈔" + +typedef struct { + const char *key; + const char *icon; // Nerd Font icon +} icon_pair; + +static const icon_pair exact_match_icons[] = { + {"Makefile", ""}, {"Dockerfile", "󰡨"}, {".gitignore", ""}, + {".clang-format", ""}, {"README.md", "󰍔"}, +}; + +static const icon_pair ext_icons[] = { + {"c", ""}, {"h", ""}, {"cpp", ""}, {"py", ""}, {"rs", ""}, + {"go", ""}, {"sh", ""}, {"org", ""}, {"md", ""}, {"json", ""}, + {"png", "󰋩"}, {"jpg", "󰋩"}, {"zip", "󰿺"}, {"tar", "󰿺"}, {"gz", "󰿺"}, +}; + +const char *get_file_icon(const char *filename, bool is_dir); + +#endif /* SF_ICON_H */ -- cgit v1.2.3