aboutsummaryrefslogtreecommitdiffstats
path: root/src/icon.h
diff options
context:
space:
mode:
authorverdant <im@verdant.ee>2026-08-03 21:01:05 +0800
committerverdant <im@verdant.ee>2026-08-03 21:01:05 +0800
commit8fa00affda48e06a759915bf12e01a5ffca65e45 (patch)
tree52b2098af1d97b15c76a262388fc1d28bdf24fa6 /src/icon.h
parent55e02a195373325216a47ebddc98039faf59b51c (diff)
downloadsf-8fa00affda48e06a759915bf12e01a5ffca65e45.tar.gz
sf-8fa00affda48e06a759915bf12e01a5ffca65e45.zip
Add width character and icon support
Diffstat (limited to 'src/icon.h')
-rw-r--r--src/icon.h27
1 files changed, 27 insertions, 0 deletions
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 <stdbool.h>
+
+#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 */