From f0c32a90477c20ca8dd38c48889ca77deddc1b8b Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 30 Sep 2019 15:57:58 -0700 Subject: Ditching the whole config.def.h paradigm in favor of just having a single config.h file. It's mostly not used very much anyways now that the startup commands and key bindings are in their own files. --- Makefile | 3 --- config.def.h | 74 ------------------------------------------------------------ config.h | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 77 deletions(-) delete mode 100644 config.def.h create mode 100644 config.h diff --git a/Makefile b/Makefile index 2d46459..31a2525 100644 --- a/Makefile +++ b/Makefile @@ -57,9 +57,6 @@ all: $(NAME) clean: rm -f $(NAME) -config.h: - cp config.def.h config.h - $(NAME): $(NAME).c bterm.h config.h $(CC) $(NAME).c $(CFLAGS) $(CWARN) $(G) $(O) -o $(NAME) diff --git a/config.def.h b/config.def.h deleted file mode 100644 index f8f431e..0000000 --- a/config.def.h +++ /dev/null @@ -1,74 +0,0 @@ -/* - BB Configuration, Startup Commands, and Key Bindings - - User customization goes in config.h, which is created by running `make` - (config.def.h is for keeping the defaults around, just in case) - - This file contains: - - Global options, like which colors are used - - Column formatting (width and title) - - */ -#include "bterm.h" - -// Types: -typedef struct { - int key; - char *script; - char *description; -} binding_t; - -typedef struct { - int width; - const char *name; -} column_t; - -// Configurable options: -#define SCROLLOFF MIN(5, (termheight-4)/2) -#define CMDFILE_FORMAT "/tmp/bb.XXXXXX" -#define SORT_INDICATOR "↓" -#define RSORT_INDICATOR "↑" -#define SELECTED_INDICATOR " \033[31;7m \033[0m" -#define NOT_SELECTED_INDICATOR " " -// Colors (using ANSI escape sequences): -#define TITLE_COLOR "\033[37;1m" -#define NORMAL_COLOR "\033[37m" -#define CURSOR_COLOR "\033[43;30;1m" -#define LINK_COLOR "\033[35m" -#define DIR_COLOR "\033[34m" -#define EXECUTABLE_COLOR "\033[31m" - -#ifndef SH -#define SH "sh" -#endif - -// These commands will run at startup (before command-line arguments) -extern const column_t columns[128]; -extern binding_t bindings[1024]; - -// Column widths and titles: -const column_t columns[128] = { - ['*'] = {2, "*"}, - ['a'] = {21, " Accessed"}, - ['c'] = {21, " Created"}, - ['m'] = {21, " Modified"}, - ['n'] = {40, "Name"}, - ['p'] = {5, "Permissions"}, - ['r'] = {2, "Random"}, - ['s'] = {9, " Size"}, -}; - -/****************************************************************************** - * These are all the key bindings for bb. - * The format is: {{keys,...}, "