From bc2bc8fce06e177522ea4cb1d385a2830a8d96c4 Mon Sep 17 00:00:00 2001 From: nova Date: Fri, 13 Jun 2025 01:28:16 +0200 Subject: [PATCH] added config.h --- config.h | 7 +++++++ defines.h | 17 +++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 config.h diff --git a/config.h b/config.h new file mode 100644 index 0000000..58321bf --- /dev/null +++ b/config.h @@ -0,0 +1,7 @@ +#include "defines.h" + + +static file_preview file_previews[] = { + { "c", "&a" }, + { ".c", "&ueberzug" }, +}; diff --git a/defines.h b/defines.h index 25d16db..5bc867f 100644 --- a/defines.h +++ b/defines.h @@ -1,3 +1,8 @@ +#ifndef CONFIG_GUARD +#define CONFIG_GUARD +#include "config.h" +#endif + #define STATUS_QUIT_PROGRAM 1 #define STATUS_RUN_BACKEND 2 #define STATUS_RELOAD_DIRECTORY 4 @@ -21,6 +26,7 @@ #define FILE_STATUS_HOVER 1 #define FILE_STATUS_SELECTED 2; #define FILE_STATUS_IS_REGULAR_FILE 4 +#define FILE_STATUS_FILE_OPEN 128 /* only used for file previews */ #define COLOR_UNKNOWN 0 #define COLOR_DIR 1 @@ -44,9 +50,10 @@ #define FILE_TYPE_SOCK COLOR_SOCK #define FILE_TYPE_FIFO COLOR_FIFO #define FILE_TYPE_ORPHAN COLOR_ORPHAN +#define FILE_TYPE_OPEN_FILE 128 /* this is only used in rgt_content to print a file preview, not the dir */ -#ifndef GUARD -#define GUARD +#ifndef STRUCT_GUARD +#define STRUCT_GUARD /* complex types are good actually */ typedef struct File { @@ -61,5 +68,11 @@ typedef struct Color { char *file_extension; short color_pair; } color; +typedef struct File_preview { + char *file_extension; + char *command; /* this will blindly execute any inserted shell command */ + /* commands with an '&' prefix are inbuild */ +} file_preview; + #endif