noice

small file browser
git clone git://git.2f30.org/noice.git
Log | Files | Refs | README | LICENSE

config.def.h (3244B)


      1 /* See LICENSE file for copyright and license details. */
      2 #define CWD   "cwd: "
      3 #define CURSR " > "
      4 #define EMPTY "   "
      5 
      6 int dirorder    = 0; /* Set to 1 to sort by directory first */
      7 int mtimeorder  = 0; /* Set to 1 to sort by time modified */
      8 int icaseorder  = 0; /* Set to 1 to sort by ignoring case */
      9 int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
     10 int showhidden  = 0; /* Set to 1 to show hidden files by default */
     11 int usecolor    = 0; /* Set to 1 to enable color attributes */
     12 char *idlecmd   = "rain"; /* The screensaver program */
     13 
     14 /* See curs_attr(3) for valid video attributes */
     15 #define CURSR_ATTR A_NORMAL
     16 #define DIR_ATTR   A_NORMAL | COLOR_PAIR(4)
     17 #define LINK_ATTR  A_NORMAL | COLOR_PAIR(6)
     18 #define SOCK_ATTR  A_NORMAL | COLOR_PAIR(1)
     19 #define FIFO_ATTR  A_NORMAL | COLOR_PAIR(5)
     20 #define EXEC_ATTR  A_NORMAL | COLOR_PAIR(2)
     21 
     22 /* Colors to use with COLOR_PAIR(n) as attributes */
     23 struct cpair pairs[] = {
     24 	{ .fg = 0, .bg = 0 },
     25 	/* pairs start at 1 */
     26 	{ COLOR_RED,     -1 },
     27 	{ COLOR_GREEN,   -1 },
     28 	{ COLOR_YELLOW,  -1 },
     29 	{ COLOR_BLUE,    -1 },
     30 	{ COLOR_MAGENTA, -1 },
     31 	{ COLOR_CYAN,    -1 },
     32 };
     33 
     34 struct assoc assocs[] = {
     35 	{ .regex = "\\.(avi|mp4|mkv|mp3|ogg|flac|mov)$", .file = "mpv", .argv = { "mpv", "{}", NULL } },
     36 	{ .regex = "\\.(png|jpg|gif)$", .file = "sxiv", .argv = { "sxiv", "{}", NULL} },
     37 	{ .regex = "\\.(html|svg)$", .file = "firefox", .argv = { "firefox", "{}", NULL } },
     38 	{ .regex = "\\.pdf$", .file = "mupdf", .argv = { "mupdf", "{}", NULL} },
     39 	{ .regex = "\\.sh$", .file = "sh", .argv = { "sh", "{}", NULL} },
     40 	{ .regex = ".", .file = "less", .argv = { "less", "{}", NULL } },
     41 };
     42 
     43 struct key bindings[] = {
     44 	/* Quit */
     45 	{ 'q',            SEL_QUIT },
     46 	/* Back */
     47 	{ KEY_BACKSPACE,  SEL_BACK },
     48 	{ KEY_LEFT,       SEL_BACK },
     49 	{ 'h',            SEL_BACK },
     50 	{ CONTROL('H'),   SEL_BACK },
     51 	/* Inside */
     52 	{ KEY_ENTER,      SEL_GOIN },
     53 	{ '\r',           SEL_GOIN },
     54 	{ KEY_RIGHT,      SEL_GOIN },
     55 	{ 'l',            SEL_GOIN },
     56 	/* Filter */
     57 	{ '/',            SEL_FLTR },
     58 	{ '&',            SEL_FLTR },
     59 	/* Next */
     60 	{ 'j',            SEL_NEXT },
     61 	{ KEY_DOWN,       SEL_NEXT },
     62 	{ CONTROL('N'),   SEL_NEXT },
     63 	/* Previous */
     64 	{ 'k',            SEL_PREV },
     65 	{ KEY_UP,         SEL_PREV },
     66 	{ CONTROL('P'),   SEL_PREV },
     67 	/* Page down */
     68 	{ KEY_NPAGE,      SEL_PGDN },
     69 	{ CONTROL('D'),   SEL_PGDN },
     70 	/* Page up */
     71 	{ KEY_PPAGE,      SEL_PGUP },
     72 	{ CONTROL('U'),   SEL_PGUP },
     73 	/* Home */
     74 	{ KEY_HOME,       SEL_HOME },
     75 	{ META('<'),      SEL_HOME },
     76 	{ '^',            SEL_HOME },
     77 	/* End */
     78 	{ KEY_END,        SEL_END },
     79 	{ META('>'),      SEL_END },
     80 	{ '$',            SEL_END },
     81 	/* Change dir */
     82 	{ 'c',            SEL_CD },
     83 	{ '~',            SEL_CDHOME },
     84 	/* Toggle hide .dot files */
     85 	{ '.',            SEL_TOGGLEDOT },
     86 	/* Toggle sort by directory first */
     87 	{ 'd',            SEL_DSORT },
     88 	/* Toggle sort by time */
     89 	{ 't',            SEL_MTIME },
     90 	/* Toggle case sensitivity */
     91 	{ 'i',            SEL_ICASE },
     92 	{ CONTROL('L'),   SEL_REDRAW },
     93 	/* Run command */
     94 	{ 'z',            SEL_RUN, "top" },
     95 	{ '!',            SEL_RUN, "sh", "SHELL" },
     96 	/* Run command with argument */
     97 	{ 'e',            SEL_RUNARG, "vi", "EDITOR" },
     98 	{ 'p',            SEL_RUNARG, "less", "PAGER" },
     99 };