2015-11-20 14:36:40 +00:00
|
|
|
/* See LICENSE file for copyright and license details. */
|
2016-08-22 11:23:47 +01:00
|
|
|
#define CWD "cwd: "
|
2014-10-21 11:35:08 +01:00
|
|
|
#define CURSR " > "
|
|
|
|
#define EMPTY " "
|
|
|
|
|
2017-04-01 14:41:07 +05:30
|
|
|
static int mtimeorder = 0; /* Set to 1 to sort by time modified */
|
|
|
|
static int sizeorder = 0; /* Set to 1 to sort by file size */
|
2017-04-10 00:11:29 +05:30
|
|
|
static int bsizeorder = 0; /* Set to 1 to sort by blocks used including content */
|
2017-04-01 14:41:07 +05:30
|
|
|
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
|
|
|
|
2017-04-23 23:12:54 +05:30
|
|
|
static struct assoc assocs[] = {
|
|
|
|
{ "\\.(c|cpp|h|log|md|py|sh|txt)$", "text" },
|
|
|
|
{ "\\.(3g2|3gp|asf|avi|divx|flv|m2v|m4v|mkv|mov|mp4|mp4v|mpeg|mpg|ogv|qt|rm|rmvb|vob|webm|wmv)$", "video" },
|
|
|
|
{ "\\.(aac|ac3|amr|flac|m4a|m4b|m4p|mp3|mp4a|ogg|opus|ra|wav|wma)$", "audio" },
|
|
|
|
{ "\\.(bmp|gif|jpeg|jpg|pbm|pgm|png|svg|tiff|webp)$", "image" },
|
|
|
|
{ "\\.pdf$", "pdf" },
|
2014-10-21 11:15:27 +01:00
|
|
|
};
|
2014-11-06 13:46:37 +02:00
|
|
|
|
2017-04-23 23:12:54 +05:30
|
|
|
static struct key bindings[] = {
|
2014-11-06 13:46:37 +02:00
|
|
|
/* Quit */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ 'q', SEL_QUIT, "", "" },
|
2017-04-19 18:22:30 +05:30
|
|
|
{ 'Q', SEL_CDQUIT, "", "" },
|
2014-11-06 13:46:37 +02:00
|
|
|
/* Back */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ KEY_BACKSPACE, SEL_BACK, "", "" },
|
|
|
|
{ KEY_LEFT, SEL_BACK, "", "" },
|
|
|
|
{ 'h', SEL_BACK, "", "" },
|
|
|
|
{ CONTROL('H'), SEL_BACK, "", "" },
|
2014-11-06 13:46:37 +02:00
|
|
|
/* Inside */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ KEY_ENTER, SEL_GOIN, "", "" },
|
|
|
|
{ '\r', SEL_GOIN, "", "" },
|
|
|
|
{ KEY_RIGHT, SEL_GOIN, "", "" },
|
|
|
|
{ 'l', SEL_GOIN, "", "" },
|
2014-11-06 13:46:37 +02:00
|
|
|
/* Filter */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ '/', SEL_FLTR, "", "" },
|
2014-11-06 13:46:37 +02:00
|
|
|
/* Next */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ 'j', SEL_NEXT, "", "" },
|
|
|
|
{ KEY_DOWN, SEL_NEXT, "", "" },
|
|
|
|
{ CONTROL('N'), SEL_NEXT, "", "" },
|
2014-11-06 13:46:37 +02:00
|
|
|
/* Previous */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ 'k', SEL_PREV, "", "" },
|
|
|
|
{ KEY_UP, SEL_PREV, "", "" },
|
|
|
|
{ CONTROL('P'), SEL_PREV, "", "" },
|
2014-11-06 13:46:37 +02:00
|
|
|
/* Page down */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ KEY_NPAGE, SEL_PGDN, "", "" },
|
|
|
|
{ CONTROL('D'), SEL_PGDN, "", "" },
|
2014-11-06 13:46:37 +02:00
|
|
|
/* Page up */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ KEY_PPAGE, SEL_PGUP, "", "" },
|
|
|
|
{ CONTROL('U'), SEL_PGUP, "", "" },
|
2017-04-24 02:36:49 +05:30
|
|
|
/* First entry */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ KEY_HOME, SEL_HOME, "", "" },
|
2017-04-04 09:16:29 +05:30
|
|
|
{ 'g', SEL_HOME, "", "" },
|
2017-04-03 22:33:46 +05:30
|
|
|
{ CONTROL('A'), SEL_HOME, "", "" },
|
|
|
|
{ '^', SEL_HOME, "", "" },
|
2017-04-24 02:36:49 +05:30
|
|
|
/* Last entry */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ KEY_END, SEL_END, "", "" },
|
2017-04-04 09:16:29 +05:30
|
|
|
{ 'G', SEL_END, "", "" },
|
2017-04-03 22:33:46 +05:30
|
|
|
{ CONTROL('E'), SEL_END, "", "" },
|
|
|
|
{ '$', SEL_END, "", "" },
|
2014-11-06 13:46:37 +02:00
|
|
|
/* Change dir */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ 'c', SEL_CD, "", "" },
|
2017-04-08 13:46:03 +05:30
|
|
|
/* HOME */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ '~', SEL_CDHOME, "", "" },
|
2017-04-24 02:36:49 +05:30
|
|
|
/* Initial directory */
|
|
|
|
{ '&', SEL_CDBEGIN, "", "" },
|
2017-04-08 13:46:03 +05:30
|
|
|
/* Last visited dir */
|
2017-04-25 10:01:52 +05:30
|
|
|
{ '-', SEL_CDLAST, "", "" },
|
2016-02-25 14:54:41 +00:00
|
|
|
/* Toggle hide .dot files */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ '.', SEL_TOGGLEDOT, "", "" },
|
2017-03-30 01:51:52 +05:30
|
|
|
/* Detailed listing */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ 'd', SEL_DETAIL, "", "" },
|
2017-04-03 05:05:14 +05:30
|
|
|
/* File details */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ 'D', SEL_STATS, "", "" },
|
2017-04-21 23:56:48 +05:30
|
|
|
/* Show mediainfo short */
|
|
|
|
{ 'm', SEL_MEDIA, "", "" },
|
|
|
|
/* Show mediainfo full */
|
|
|
|
{ 'M', SEL_FMEDIA, "", "" },
|
2017-04-12 22:18:03 +05:30
|
|
|
/* Open dir in desktop file manager */
|
|
|
|
{ 'o', SEL_DFB, "", "" },
|
2017-03-30 01:51:52 +05:30
|
|
|
/* Toggle sort by size */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ 's', SEL_FSIZE, "", "" },
|
2017-04-10 00:11:29 +05:30
|
|
|
/* Sort by total block size including dir contents */
|
|
|
|
{ 'S', SEL_BSIZE, "", "" },
|
2015-02-05 17:53:50 +02:00
|
|
|
/* Toggle sort by time */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ 't', SEL_MTIME, "", "" },
|
|
|
|
{ CONTROL('L'), SEL_REDRAW, "", "" },
|
2017-03-30 21:17:00 +05:30
|
|
|
/* Copy currently selected file path */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ CONTROL('K'), SEL_COPY, "", "" },
|
|
|
|
/* Show help */
|
|
|
|
{ '?', SEL_HELP, "", "" },
|
2015-03-12 16:12:01 +02:00
|
|
|
/* Run command */
|
2017-04-03 22:33:46 +05:30
|
|
|
{ 'z', SEL_RUN, "top", "" },
|
2017-04-01 14:41:07 +05:30
|
|
|
{ '!', SEL_RUN, "sh", "SHELL" },
|
2015-03-12 16:12:01 +02:00
|
|
|
/* Run command with argument */
|
2017-04-01 14:41:07 +05:30
|
|
|
{ 'e', SEL_RUNARG, "vi", "EDITOR" },
|
|
|
|
{ 'p', SEL_RUNARG, "less", "PAGER" },
|
2014-11-06 13:46:37 +02:00
|
|
|
};
|