nnn/src/icons.h

261 lines
8.4 KiB
C
Raw Normal View History

#include "icons-in-terminal.h"
struct icon_pair {
const char *match;
const char *icon;
2020-08-16 08:19:09 +00:00
/*
* Hex xterm 256 color code, 0 to follow file specific (if any)
* Codes: https://jonasjacek.github.io/colors/
*/
const unsigned char color;
};
2020-08-16 01:24:47 +00:00
/*
* Define a string to be printed before and after the icon
* Adjust if the icons are not printed properly
*/
#define ICON_PADDING_LEFT ""
#define ICON_PADDING_RIGHT " "
2020-08-16 08:19:09 +00:00
#define VIDEO_COLOR 93 /* Purple */
#define AUDIO_COLOR 220 /* Gold1 */
#define IMAGE_COLOR 82 /* Chartreuse2 */
#define BOOKS_COLOR 202 /* OrangeRed1 */
#define ARCHIVE_COLOR 209 /* Salmon1 */
/*
* Using symbols defined in icons-in-terminal.h, or even using icons-in-terminal is not necessary.
* You can use whatever pathched font you like. You just have to put the desired icon as a string.
* If you are using icons-in-terminal the creator recommends that you do use the symbols in the generated header.
*/
2020-08-16 12:40:26 +00:00
static const struct icon_pair dir_icon = {"", FA_FOLDER, 0};
static const struct icon_pair file_icon = {"", FA_FILE_O, 0};
static const struct icon_pair exec_icon = {"", FA_COG, 0};
/* All entries are case-insensitive */
static const struct icon_pair icons_name[] = {
2020-08-16 12:40:26 +00:00
{".git", FA_GIT, 0},
{"Desktop", FA_DESKTOP, 0},
{"Documents", FA_BRIEFCASE, 0},
{"Downloads", FA_DOWNLOAD, 0},
{"Music", FA_MUSIC, 0},
{"Pictures", MD_CAMERA_ALT, 0},
{"Public", FA_INBOX, 0},
{"Templates", FA_PAPERCLIP, 0},
{"Videos", FA_FILM, 0},
{"CHANGELOG", FA_HISTORY, 0},
{"configure", FILE_CONFIG, 0},
{"License", FA_COPYRIGHT, 0},
{"Makefile", FILE_CMAKE, 0},
};
2020-08-16 01:24:47 +00:00
/*
* New entries should bu added such that the first character of the extension is in the correct group .
* This is done for performance reason so that the correct icon can be found faster.
* All entries are case-insensitive
*/
static const struct icon_pair icons_ext[] = {
/* Numbers */
{"1", FILE_MANPAGE, 0},
2020-08-16 08:19:09 +00:00
{"7z", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
/* A */
{"a", FILE_MANPAGE, 0},
2020-08-16 08:19:09 +00:00
{"apk", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"asm", FILE_NASM, 0},
2020-08-16 08:19:09 +00:00
{"aup", FA_FILE_AUDIO_O, AUDIO_COLOR},
{"avi", FA_FILE_MOVIE_O, VIDEO_COLOR},
/* B */
{"bat", MFIZZ_SCRIPT, 0},
2020-08-16 12:40:26 +00:00
{"bin", OCT_FILE_BINARY, 0},
2020-08-16 08:19:09 +00:00
{"bmp", FA_FILE_IMAGE_O, IMAGE_COLOR},
{"bz2", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
/* C */
{"c", MFIZZ_C, 0},
{"c++", MFIZZ_CPLUSPLUS, 0},
2020-08-16 08:19:09 +00:00
{"cab", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"cbr", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"cbz", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"cc", MFIZZ_CPLUSPLUS, 0},
{"class", MFIZZ_JAVA, 0},
{"clj", MFIZZ_CLOJURE, 0},
{"cljc", MFIZZ_CLOJURE, 0},
{"cljs", MFIZZ_CLOJURE, 0},
{"cmake", FILE_CMAKE, 0},
{"coffee", MFIZZ_COFFEE_BEAN, 0},
{"conf", FA_COGS, 0},
2020-08-16 08:19:09 +00:00
{"cpio", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"cpp", MFIZZ_CPLUSPLUS, 0},
{"css", MFIZZ_CSS3, 0},
2020-08-16 08:19:09 +00:00
{"cue", FA_FILE_AUDIO_O, AUDIO_COLOR},
{"cvs", FA_COGS, 0},
{"cxx", MFIZZ_CPLUSPLUS, 0},
/* D */
{"db", MFIZZ_DATABASE_ALT2, 0},
2020-08-16 08:19:09 +00:00
{"deb", MFIZZ_DEBIAN, ARCHIVE_COLOR},
2020-08-16 12:40:26 +00:00
{"diff", FILE_DIFF, 0},
{"dll", FILE_MANPAGE, 0},
{"doc", FILE_WORD, 0},
{"docx", FILE_WORD, 0},
/* E */
{"ejs", FA_FILE_CODE_O, 0},
{"elf", FA_LINUX, 0},
2020-08-16 08:19:09 +00:00
{"epub", FA_FILE_PDF_O, BOOKS_COLOR},
{"exe", FA_WINDOWS, 0},
2020-08-16 01:24:47 +00:00
/* F */
{"f#", DEV_FSHARP, 0},
2020-08-16 08:19:09 +00:00
{"flac", FA_FILE_AUDIO_O, AUDIO_COLOR},
{"flv", FA_FILE_MOVIE_O, VIDEO_COLOR},
{"fs", DEV_FSHARP, 0},
{"fsi", DEV_FSHARP, 0},
{"fsscript", DEV_FSHARP, 0},
{"fsx", DEV_FSHARP, 0},
/* G */
{"gem", FA_FILE_ARCHIVE_O, 0},
2020-08-16 08:19:09 +00:00
{"gif", FA_FILE_IMAGE_O, IMAGE_COLOR},
{"go", MFIZZ_GO, 0},
2020-08-16 08:19:09 +00:00
{"gz", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"gzip", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
/* H */
{"h", MFIZZ_C, 0},
{"hh", MFIZZ_CPLUSPLUS, 0},
{"htaccess", FA_COGS, 0},
{"htpasswd", FA_COGS, 0},
{"htm", FA_FILE_CODE_O, 0},
{"html", FA_FILE_CODE_O, 0},
{"hxx", MFIZZ_CPLUSPLUS, 0},
/* I */
2020-08-16 08:19:09 +00:00
{"ico", FA_FILE_IMAGE_O, IMAGE_COLOR},
{"img", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"ini", FA_COGS, 0},
2020-08-16 08:19:09 +00:00
{"iso", LINEA_MUSIC_CD, ARCHIVE_COLOR},
/* J */
{"jar", MFIZZ_JAVA, 0},
{"java", MFIZZ_JAVA, 0},
{"jl", FA_COGS, 0},
2020-08-16 08:19:09 +00:00
{"jpeg", FA_FILE_IMAGE_O, IMAGE_COLOR},
{"jpg", FA_FILE_IMAGE_O, IMAGE_COLOR},
{"js", DEV_JAVASCRIPT_BADGE, 0},
{"json", MFIZZ_JAVASCRIPT, 0},
{"jsx", FILE_JSX, 0},
/* K */
/* L */
2020-08-16 08:19:09 +00:00
{"lha", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"log", FA_FILE_TEXT_O, 0},
{"lua", FILE_LUA, 0},
2020-08-16 08:19:09 +00:00
{"lzh", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"lzma", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
/* M */
2020-08-16 08:19:09 +00:00
{"m4a", FA_FILE_AUDIO_O, AUDIO_COLOR},
{"m4v", FA_FILE_MOVIE_O, VIDEO_COLOR},
{"markdown", DEV_MARKDOWN, 0},
{"md", DEV_MARKDOWN, 0},
{"mk", FILE_CMAKE, 0},
2020-08-16 08:19:09 +00:00
{"mkv", FA_FILE_MOVIE_O, VIDEO_COLOR},
{"mov", FA_FILE_MOVIE_O, VIDEO_COLOR},
{"mp3", FA_FILE_AUDIO_O, AUDIO_COLOR},
{"mp4", FA_FILE_MOVIE_O, VIDEO_COLOR},
{"mpeg", FA_FILE_MOVIE_O, VIDEO_COLOR},
{"mpg", FA_FILE_MOVIE_O, VIDEO_COLOR},
{"msi", FA_WINDOWS, 0},
/* N */
/* O */
2020-08-16 21:25:21 +00:00
{"o", FILE_MANPAGE, 0},
{"ogg", FA_FILE_AUDIO_O, AUDIO_COLOR},
{"opdownload", FA_DOWNLOAD, 0},
{"out", FA_LINUX, 0},
/* P */
2020-08-16 21:25:21 +00:00
{"part", FA_DOWNLOAD, 0},
2020-08-16 12:40:26 +00:00
{"patch", FILE_PATCH, 0},
2020-08-16 08:19:09 +00:00
{"pdf", FA_FILE_PDF_O, BOOKS_COLOR},
{"php", MFIZZ_PHP, 0},
2020-08-16 08:19:09 +00:00
{"png", FA_FILE_IMAGE_O, IMAGE_COLOR},
{"ppt", FILE_POWERPOINT, 0},
{"pptx", FILE_POWERPOINT, 0},
{"psb", DEV_PHOTOSHOP, 0},
{"psd", DEV_PHOTOSHOP, 0},
{"py", MFIZZ_PYTHON, 0},
{"pyc", MFIZZ_PYTHON, 0},
{"pyd", MFIZZ_PYTHON, 0},
{"pyo", MFIZZ_PYTHON, 0},
/* Q */
/* R */
2020-08-16 08:19:09 +00:00
{"rar", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"rc", FA_COGS, 0},
{"rom", FA_LOCK, 0},
2020-08-16 08:19:09 +00:00
{"rpm", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"rss", FA_RSS_SQUARE, 0},
{"rtf", FA_FILE_PDF_O, 0},
/* S */
{"so", FILE_MANPAGE, 0},
{"scala", MFIZZ_SCALA, 0},
{"sh", MFIZZ_SCRIPT, 0},
{"slim", FA_FILE_CODE_O, 0},
{"sln", DEV_VISUALSTUDIO, 0},
{"sql", MFIZZ_MYSQL, 0},
2020-08-16 12:40:26 +00:00
{"srt", FA_COMMENTS_O, 0},
{"sub", FA_COMMENTS_O, 0},
2020-08-16 08:19:09 +00:00
{"svg", FA_FILE_IMAGE_O, IMAGE_COLOR},
/* T */
2020-08-16 08:19:09 +00:00
{"tar", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"tex", FILE_TEX, 0},
2020-08-16 08:19:09 +00:00
{"tgz", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"ts", FILE_TS, 0},
{"tsx", FILE_TSX, 0},
{"txt", FA_FILE_TEXT_O, 0},
2020-08-16 08:19:09 +00:00
{"txz", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
/* U */
/* V */
2020-08-16 21:25:21 +00:00
{"vid", FA_FILE_MOVIE_O, VIDEO_COLOR},
{"vim", DEV_VIM, 0},
{"vimrc", DEV_VIM, 0},
/* W */
2020-08-16 08:19:09 +00:00
{"wav", FA_FILE_AUDIO_O, AUDIO_COLOR},
{"webm", FA_FILE_MOVIE_O, VIDEO_COLOR},
{"wma", FA_FILE_AUDIO_O, AUDIO_COLOR},
{"wmv", FA_FILE_MOVIE_O, VIDEO_COLOR},
/* X */
2020-08-16 08:19:09 +00:00
{"xbps", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
{"xhtml", FA_FILE_CODE_O, 0},
{"xls", FILE_EXCEL, 0},
{"xlsx", FILE_EXCEL, 0},
{"xml", FA_FILE_CODE_O, 0},
2020-08-16 08:19:09 +00:00
{"xz", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR},
/* Y */
{"yaml", FA_COGS, 0},
{"yml", FA_COGS, 0},
/* Z */
2020-08-16 08:19:09 +00:00
{"zip", FA_FILE_ARCHIVE_O, ARCHIVE_COLOR}
/* Other */
};