2015-11-20 14:36:40 +00:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
2016-08-22 10:23:47 +00:00
|
|
|
#define CWD "cwd: "
|
2014-10-21 10:35:08 +00:00
|
|
|
#define CURSR " > "
|
|
|
|
#define EMPTY " "
|
|
|
|
|
2017-04-01 09:11:07 +00:00
|
|
|
static int mtimeorder = 0; /* Set to 1 to sort by time modified */
|
|
|
|
static int sizeorder = 0; /* Set to 1 to sort by file size */
|
|
|
|
static int idletimeout = 0; /* Screensaver timeout in seconds, 0 to disable */
|
|
|
|
static int showhidden = 0; /* Set to 1 to show hidden files by default */
|
|
|
|
static int showdetail = 0; /* Set to show additional file info */
|
|
|
|
static 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" },
|
2017-03-31 18:05:48 +00:00
|
|
|
{ "\\.(c|cpp|h|txt|log|sh)$", "vi" },
|
2017-03-31 22:23:49 +00:00
|
|
|
{ "\\.(wma|mp3|ogg|flac)$", "mpv" },
|
2016-08-20 14:35:35 +00:00
|
|
|
//{ "\\.(png|jpg|gif)$", "feh" },
|
|
|
|
//{ "\\.(html|svg)$", "firefox" },
|
|
|
|
{ "\\.pdf$", "zathura" },
|
2017-03-31 18:05:48 +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 */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ 'q', SEL_QUIT, "\0", "\0" },
|
2014-11-06 11:46:37 +00:00
|
|
|
/* Back */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ KEY_BACKSPACE, SEL_BACK, "\0", "\0" },
|
|
|
|
{ KEY_LEFT, SEL_BACK, "\0", "\0" },
|
|
|
|
{ 'h', SEL_BACK, "\0", "\0" },
|
|
|
|
{ CONTROL('H'), SEL_BACK, "\0", "\0" },
|
2014-11-06 11:46:37 +00:00
|
|
|
/* Inside */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ KEY_ENTER, SEL_GOIN, "\0", "\0" },
|
|
|
|
{ '\r', SEL_GOIN, "\0", "\0" },
|
|
|
|
{ KEY_RIGHT, SEL_GOIN, "\0", "\0" },
|
|
|
|
{ 'l', SEL_GOIN, "\0", "\0" },
|
2014-11-06 11:46:37 +00:00
|
|
|
/* Filter */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ '/', SEL_FLTR, "\0", "\0" },
|
|
|
|
{ '&', SEL_FLTR, "\0", "\0" },
|
2014-11-06 11:46:37 +00:00
|
|
|
/* Next */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ 'j', SEL_NEXT, "\0", "\0" },
|
|
|
|
{ KEY_DOWN, SEL_NEXT, "\0", "\0" },
|
|
|
|
{ CONTROL('N'), SEL_NEXT, "\0", "\0" },
|
2014-11-06 11:46:37 +00:00
|
|
|
/* Previous */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ 'k', SEL_PREV, "\0", "\0" },
|
|
|
|
{ KEY_UP, SEL_PREV, "\0", "\0" },
|
|
|
|
{ CONTROL('P'), SEL_PREV, "\0", "\0" },
|
2014-11-06 11:46:37 +00:00
|
|
|
/* Page down */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ KEY_NPAGE, SEL_PGDN, "\0", "\0" },
|
|
|
|
{ CONTROL('D'), SEL_PGDN, "\0", "\0" },
|
2014-11-06 11:46:37 +00:00
|
|
|
/* Page up */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ KEY_PPAGE, SEL_PGUP, "\0", "\0" },
|
|
|
|
{ CONTROL('U'), SEL_PGUP, "\0", "\0" },
|
2015-07-12 12:32:31 +00:00
|
|
|
/* Home */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ KEY_HOME, SEL_HOME, "\0", "\0" },
|
|
|
|
{ CONTROL('A'), SEL_HOME, "\0", "\0" },
|
|
|
|
{ '^', SEL_HOME, "\0", "\0" },
|
2015-07-12 12:32:31 +00:00
|
|
|
/* End */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ KEY_END, SEL_END, "\0", "\0" },
|
|
|
|
{ CONTROL('E'), SEL_END, "\0", "\0" },
|
|
|
|
{ '$', SEL_END, "\0", "\0" },
|
2014-11-06 11:46:37 +00:00
|
|
|
/* Change dir */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ 'c', SEL_CD, "\0", "\0" },
|
|
|
|
{ '~', SEL_CDHOME, "\0", "\0" },
|
2016-02-25 14:54:41 +00:00
|
|
|
/* Toggle hide .dot files */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ '.', SEL_TOGGLEDOT, "\0", "\0" },
|
2017-03-29 20:21:52 +00:00
|
|
|
/* Detailed listing */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ 'd', SEL_DETAIL, "\0", "\0" },
|
2017-03-29 20:21:52 +00:00
|
|
|
/* Toggle sort by size */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ 's', SEL_FSIZE, "\0", "\0" },
|
2015-02-05 15:53:50 +00:00
|
|
|
/* Toggle sort by time */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ 't', SEL_MTIME, "\0", "\0" },
|
|
|
|
{ CONTROL('L'), SEL_REDRAW, "\0", "\0" },
|
2017-03-30 15:47:00 +00:00
|
|
|
/* Copy currently selected file path */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ CONTROL('K'), SEL_COPY, "\0", "\0" },
|
2015-03-12 14:12:01 +00:00
|
|
|
/* Run command */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ 'z', SEL_RUN, "top", "\0" },
|
|
|
|
{ '!', SEL_RUN, "sh", "SHELL" },
|
2015-03-12 14:12:01 +00:00
|
|
|
/* Run command with argument */
|
2017-04-01 09:11:07 +00:00
|
|
|
{ 'e', SEL_RUNARG, "vi", "EDITOR" },
|
|
|
|
{ 'p', SEL_RUNARG, "less", "PAGER" },
|
2014-11-06 11:46:37 +00:00
|
|
|
};
|