aboutsummaryrefslogtreecommitdiffstats
path: root/src/icon.h
diff options
context:
space:
mode:
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 */