[ref] statusbar, rm get_finfo(), MAX macros
[sfm.git] / config.def.h
blobcd7c7ae2b6fd863e6b02f2c878b3cab53d6ddba0
1 /* See LICENSE file for copyright and license details.*/
3 #ifndef CONFIG_H
4 #define CONFIG_H
6 /* colors fg, bg */
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 };
19 /* commands */
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 */
24 /* bookmarks */
25 static Bookmark bmarks[] = {
26 {'\\', "/root"},
29 /* software */
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 };
38 /* extensions*/
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},
57 {obj, LEN(obj), r2},
60 /* normal keys */
61 static Key nkeys[] = {
62 { {.ch = 'j'}, mvdwn },
63 { {.ch = 'k'}, mvup },
64 { {.ch = 'l'}, mvfwd },
65 { {.ch = 'h'}, mvbk },
66 { {.ch = 'g'}, mvtop },
67 { {.ch = 'G'}, mvbtm },
68 { {.ch = 'M'}, mvmid },
69 { {.key = TB_KEY_CTRL_U}, scrup },
70 { {.key = TB_KEY_CTRL_D}, scrdwn },
71 { {.ch = 'n'}, crnf },
72 { {.ch = 'N'}, crnd },
73 { {.ch = 'd'}, delfd },
74 { {.ch = 'x'}, calcdir },
75 { {.ch = '/'}, start_filter },
76 { {.ch = 'q'}, quit },
77 { {.ch = 'v'}, start_vmode },
78 { {.ch = 'y'}, yank },
79 { {.ch = 'p'}, paste },
80 { {.ch = 'P'}, selmv },
81 { {.ch = 'c'}, rname },
82 { {.key = TB_KEY_SPACE}, switch_pane },
85 /* visual keys */
86 static Key vkeys[] = {
87 { {.ch = 'j'}, seldwn },
88 { {.ch = 'k'}, selup },
89 { {.ch = 'a'}, selall },
90 { {.ch = 'y'}, selynk },
91 { {.ch = 'd'}, seldel },
92 { {.ch = 'q'}, exit_vmode },
93 { {.ch = 'v'}, exit_vmode },
94 { {.key = TB_KEY_ESC}, exit_vmode },
97 static const size_t nkeyslen = LEN(nkeys);
98 static const size_t vkeyslen = LEN(vkeys);
100 /* permissions */
101 static const mode_t ndir_perm = S_IRWXU;
102 static const mode_t nf_perm = S_IRUSR | S_IWUSR;
104 /* scroll */
105 static const int scrmv = 10; /* ctrl+u, ctrl+d movement */
106 static const int scrsp = 3; /* space before scroll */
108 /* statusbar */
109 static const char dtfmt[] = "%F %R"; /* date time format */
111 /* unicode chars */
112 #define u_hl 0x2500 /* ─ */
113 #define u_vl 0x2502 /* │ */
114 #define u_cnw 0x250C /* ┌ */
115 #define u_cne 0x2510 /* ┐ */
116 #define u_csw 0x2514 /* └ */
117 #define u_cse 0x2518 /* ┘ */
118 #define u_mn 0x252C /* ┬ */
119 #define u_ms 0x2534 /* ┴ */
121 #endif /* CONFIG_H */