2015-11-20 14:36:40 +00:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
2014-10-21 10:35:08 +00:00
|
|
|
#define CWD "cwd: "
|
|
|
|
#define CURSR " > "
|
|
|
|
#define EMPTY " "
|
|
|
|
|
2015-11-26 16:05:13 +00:00
|
|
|
int mtimeorder = 0; /* Set to 1 to sort by time modified */
|
2015-11-20 14:14:58 +00:00
|
|
|
int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
|
|
|
|
char *idlecmd = "rain"; /* The screensaver program */
|
2015-02-04 12:32:16 +00:00
|
|
|
|
2014-10-21 10:15:27 +00:00
|
|
|
struct assoc assocs[] = {
|
2016-08-20 14:35:35 +00:00
|
|
|
//{ "\\.(avi|mp4|mkv|mp3|ogg|flac|mov)$", "mpv" },
|
2016-08-21 02:55:12 +00:00
|
|
|
{ "\\.(c|cpp|h|txt|log)$", "vim" },
|
2016-08-20 14:35:35 +00:00
|
|
|
{ "\\.(wma|mp3|ogg|flac)$", "fmedia" },
|
|
|
|
//{ "\\.(png|jpg|gif)$", "feh" },
|
|
|
|
//{ "\\.(html|svg)$", "firefox" },
|
|
|
|
{ "\\.pdf$", "zathura" },
|
2014-10-21 10:15:27 +00:00
|
|
|
{ "\\.sh$", "sh" },
|
2016-08-20 14:35:35 +00:00
|
|
|
//{ ".", "less" },
|
2014-10-21 10:15:27 +00:00
|
|
|
};
|
2014-11-06 11:46:37 +00:00
|
|
|
|
|
|
|
struct key bindings[] = {
|
|
|
|
/* Quit */
|
|
|
|
{ 'q', SEL_QUIT },
|
|
|
|
/* Back */
|
|
|
|
{ KEY_BACKSPACE, SEL_BACK },
|
|
|
|
{ KEY_LEFT, SEL_BACK },
|
|
|
|
{ 'h', SEL_BACK },
|
2015-01-27 11:29:12 +00:00
|
|
|
{ CONTROL('H'), SEL_BACK },
|
2014-11-06 11:46:37 +00:00
|
|
|
/* Inside */
|
|
|
|
{ KEY_ENTER, SEL_GOIN },
|
|
|
|
{ '\r', SEL_GOIN },
|
|
|
|
{ KEY_RIGHT, SEL_GOIN },
|
|
|
|
{ 'l', SEL_GOIN },
|
|
|
|
/* Filter */
|
|
|
|
{ '/', SEL_FLTR },
|
|
|
|
{ '&', SEL_FLTR },
|
|
|
|
/* Next */
|
|
|
|
{ 'j', SEL_NEXT },
|
|
|
|
{ KEY_DOWN, SEL_NEXT },
|
|
|
|
{ CONTROL('N'), SEL_NEXT },
|
|
|
|
/* Previous */
|
|
|
|
{ 'k', SEL_PREV },
|
|
|
|
{ KEY_UP, SEL_PREV },
|
|
|
|
{ CONTROL('P'), SEL_PREV },
|
|
|
|
/* Page down */
|
|
|
|
{ KEY_NPAGE, SEL_PGDN },
|
|
|
|
{ CONTROL('D'), SEL_PGDN },
|
|
|
|
/* Page up */
|
|
|
|
{ KEY_PPAGE, SEL_PGUP },
|
|
|
|
{ CONTROL('U'), SEL_PGUP },
|
2015-07-12 12:32:31 +00:00
|
|
|
/* Home */
|
|
|
|
{ KEY_HOME, SEL_HOME },
|
|
|
|
{ CONTROL('A'), SEL_HOME },
|
|
|
|
{ '^', SEL_HOME },
|
|
|
|
/* End */
|
|
|
|
{ KEY_END, SEL_END },
|
|
|
|
{ CONTROL('E'), SEL_END },
|
|
|
|
{ '$', SEL_END },
|
2014-11-06 11:46:37 +00:00
|
|
|
/* Change dir */
|
|
|
|
{ 'c', SEL_CD },
|
2016-02-25 15:06:57 +00:00
|
|
|
{ '~', SEL_CDHOME },
|
2016-02-25 14:54:41 +00:00
|
|
|
/* Toggle hide .dot files */
|
|
|
|
{ '.', SEL_TOGGLEDOT },
|
2015-02-05 15:53:50 +00:00
|
|
|
/* Toggle sort by time */
|
2015-01-31 22:02:59 +00:00
|
|
|
{ 't', SEL_MTIME },
|
2015-03-11 18:55:28 +00:00
|
|
|
{ CONTROL('L'), SEL_REDRAW },
|
2015-03-12 14:12:01 +00:00
|
|
|
/* Run command */
|
2015-11-20 15:42:33 +00:00
|
|
|
{ 'z', SEL_RUN, "top" },
|
|
|
|
{ '!', SEL_RUN, "sh", "SHELL" },
|
2015-03-12 14:12:01 +00:00
|
|
|
/* Run command with argument */
|
2015-11-20 15:42:33 +00:00
|
|
|
{ 'e', SEL_RUNARG, "vi", "EDITOR" },
|
|
|
|
{ 'p', SEL_RUNARG, "less", "PAGER" },
|
2014-11-06 11:46:37 +00:00
|
|
|
};
|