1 /* See LICENSE file for copyright and license details.*/
7 static const Cpair cdir
= { 33, 0 };
8 static const Cpair cerr
= { 124, 0 };
9 static const Cpair cexec
= { 2, 0 };
10 static const Cpair cfile
= { 243, 0 };
11 static const Cpair cframe
= { 233, 233 };
12 static const Cpair cother
= { 3, 0 };
13 static const Cpair cpanell
= { 166, 233 };
14 static const Cpair cpanelr
= { 5, 233 };
15 static const Cpair cprompt
= { 33, 0 };
16 static const Cpair csearch
= { 255, 0 };
17 static const Cpair cstatus
= { 243, 0 };
20 static const char *rm_cmd
[] = { "rm", "-rf", NULL
}; /* delete */
21 static const char *cp_cmd
[] = { "cp", "-r", yank_file
, NULL
}; /* copy */
22 static const char *mv_cmd
[] = { "mv", yank_file
, NULL
}; /* move */
25 static Bookmark bmarks
[] = {
30 static const char *mpv
[] = { "mpv", "--fullscreen", NULL
};
31 static const char *sxiv
[] = { "sxiv", NULL
};
32 static const char *surf
[] = { "surf", NULL
};
33 static const char *mupdf
[] = { "mupdf", "-I", NULL
};
34 static const char *libreoffice
[] = { "libreoffice", NULL
};
35 static const char *gimp
[] = { "gimp", NULL
};
36 static const char *r2
[] = { "r2", "-c", "vv", NULL
};
39 static const char *images
[] = { "bmp", "jpg", "jpeg", "png", "gif", "xpm" };
40 static const char *web
[] = { "htm", "html" };
41 static const char *pdf
[] = { "epub", "pdf" };
42 static const char *arts
[] = { "xcf" };
43 static const char *obj
[] = { "o", "a", "so" };
44 static const char *videos
[] = { "avi", "flv", "wav", "webm", "wma", "wmv",
45 "m2v", "m4a", "m4v", "mkv", "mov", "mp3",
46 "mp4", "mpeg", "mpg" };
47 static const char *documents
[] = { "odt", "doc", "docx", "xls", "xlsx", "odp",
48 "ods", "pptx", "odg" };
50 static Rule rules
[] = {
51 {videos
, LEN(videos
), mpv
},
52 {images
, LEN(images
), sxiv
},
53 {web
, LEN(web
), surf
},
54 {pdf
, LEN(pdf
), mupdf
},
55 {documents
, LEN(documents
), libreoffice
},
56 {arts
, LEN(arts
), gimp
},
60 static Key nkeys
[] = {
61 { {.ch
= 'j'}, mvdwn
},
62 { {.ch
= 'k'}, mvup
},
63 { {.ch
= 'l'}, mvfor
},
64 { {.ch
= 'h'}, mvbk
},
65 { {.ch
= 'g'}, mvtop
},
66 { {.ch
= 'G'}, mvbtm
},
67 { {.ch
= 'M'}, mvmid
},
68 { {.key
= TB_KEY_CTRL_U
}, scrup
},
69 { {.key
= TB_KEY_CTRL_D
}, scrdwn
},
70 { {.ch
= 'n'}, crnf
},
71 { {.ch
= 'N'}, crnd
},
72 { {.ch
= 'd'}, delfd
},
73 { {.ch
= 'x'}, calcdir
},
74 { {.ch
= '/'}, filter
},
75 { {.ch
= 'q'}, quit
},
76 { {.ch
= 'v'}, start_vmode
},
77 { {.ch
= 'y'}, yank
},
78 { {.ch
= 'p'}, paste
},
79 { {.ch
= 'P'}, selmv
},
80 { {.ch
= 'c'}, rname
},
81 { {.key
= TB_KEY_SPACE
}, switch_pane
},
84 static Key skeys
[] = {
85 { {.ch
= 'j'}, seldwn
},
86 { {.ch
= 'k'}, selup
},
87 { {.ch
= 'a'}, selall
},
88 { {.ch
= 'y'}, selynk
},
89 { {.ch
= 'd'}, seldel
},
90 { {.ch
= 'q'}, exit_vmode
},
91 { {.ch
= 'v'}, exit_vmode
},
92 { {.key
= TB_KEY_ESC
}, exit_vmode
},
95 static const size_t nkeyslen
= LEN(nkeys
);
96 static const size_t skeyslen
= LEN(skeys
);
98 static const mode_t ndir_perm
= S_IRWXU
| S_IRWXG
|S_IROTH
| S_IXOTH
;
99 static const mode_t nf_perm
= S_IRUSR
| S_IWUSR
;
102 static const int scrmv
= 10; /* ctrl+u, ctrl+d movement */
103 static const int scrsp
= 3; /* space before scroll */
106 static const int show_ug
= 1;
107 static const int show_perm
= 1;
108 static const int show_dt
= 1;
109 static const int show_size
= 1;
110 static const char dtfmt
[] = "%F %R"; /* date time format */
113 #define u_hl 0x2500 /* ─ */
114 #define u_vl 0x2502 /* │ */
115 #define u_cnw 0x250C /* ┌ */
116 #define u_cne 0x2510 /* ┐ */
117 #define u_csw 0x2514 /* └ */
118 #define u_cse 0x2518 /* ┘ */
119 #define u_mn 0x252C /* ┬ */
120 #define u_ms 0x2534 /* ┴ */
122 #endif /* CONFIG_H */