[ref] spawn use memcpy instead of for loops
[sfm.git] / config.def.h
blob5a7fb7fc20674a95c13f043d26524dee3677614e
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" }; /* delete */
21 static const char *cp_cmd[] = { "cp", "-r" }; /* copy */
22 static const char *mv_cmd[] = { "mv" }; /* move */
24 static const size_t rm_cmd_len = LEN(rm_cmd);
25 static const size_t cp_cmd_len = LEN(cp_cmd);
26 static const size_t mv_cmd_len = LEN(mv_cmd);
28 /* bookmarks */
29 static Bookmark bmarks[] = {
30 {'\\', "/root"},
33 /* software */
34 static const char *mpv[] = { "mpv", "--fullscreen" };
35 static const char *sxiv[] = { "sxiv" };
36 static const char *surf[] = { "surf" };
37 static const char *mupdf[] = { "mupdf", "-I" };
38 static const char *libreoffice[] = { "libreoffice" };
39 static const char *gimp[] = { "gimp" };
40 static const char *r2[] = { "r2", "-c", "vv" };
42 /* extensions*/
43 static const char *images[] = { "bmp", "jpg", "jpeg", "png", "gif", "xpm" };
44 static const char *web[] = { "htm", "html" };
45 static const char *pdf[] = { "epub", "pdf" };
46 static const char *arts[] = { "xcf" };
47 static const char *obj[] = { "o", "a", "so" };
48 static const char *videos[] = { "avi", "flv", "wav", "webm", "wma", "wmv",
49 "m2v", "m4a", "m4v", "mkv", "mov", "mp3",
50 "mp4", "mpeg", "mpg" };
51 static const char *documents[] = { "odt", "doc", "docx", "xls", "xlsx", "odp",
52 "ods", "pptx", "odg" };
54 static Rule rules[] = {
55 {videos, LEN(videos), mpv, LEN(mpv) },
56 {images, LEN(images), sxiv, LEN(sxiv) },
57 {web, LEN(web), surf, LEN(surf) },
58 {pdf, LEN(pdf), mupdf, LEN(mupdf) },
59 {documents, LEN(documents), libreoffice, LEN(libreoffice) },
60 {arts, LEN(arts), gimp, LEN(gimp) },
61 {obj, LEN(obj), r2, LEN(r2) },
64 /* normal keys */
65 static Key nkeys[] = {
66 { {.ch = 'j'}, mvdwn },
67 { {.key = TB_KEY_ARROW_DOWN}, mvdwn },
68 { {.ch = 'k'}, mvup },
69 { {.key = TB_KEY_ARROW_UP}, mvup },
70 { {.ch = 'l'}, mvfwd },
71 { {.key = TB_KEY_ARROW_RIGHT}, mvfwd },
72 { {.ch = 'h'}, mvbk },
73 { {.key = TB_KEY_ARROW_LEFT}, mvbk },
74 { {.ch = 'g'}, mvtop },
75 { {.ch = 'G'}, mvbtm },
76 { {.ch = 'M'}, mvmid },
77 { {.key = TB_KEY_CTRL_U}, scrup },
78 { {.key = TB_KEY_CTRL_D}, scrdwn },
79 { {.ch = 'n'}, crnf },
80 { {.ch = 'N'}, crnd },
81 { {.ch = 'd'}, delfd },
82 { {.ch = 'x'}, calcdir },
83 { {.ch = '/'}, start_filter },
84 { {.ch = 'q'}, quit },
85 { {.ch = 'v'}, start_vmode },
86 { {.ch = 'y'}, yank },
87 { {.ch = 'p'}, paste },
88 { {.ch = 'P'}, selmv },
89 { {.ch = 'c'}, rname },
90 { {.key = TB_KEY_SPACE}, switch_pane },
93 /* visual keys */
94 static Key vkeys[] = {
95 { {.ch = 'j'}, seldwn },
96 { {.key = TB_KEY_ARROW_DOWN}, seldwn },
97 { {.ch = 'k'}, selup },
98 { {.key = TB_KEY_ARROW_UP}, selup },
99 { {.ch = 'a'}, selall },
100 { {.ch = 'y'}, selynk },
101 { {.ch = 'd'}, seldel },
102 { {.ch = 'q'}, exit_vmode },
103 { {.ch = 'v'}, exit_vmode },
104 { {.key = TB_KEY_ESC}, exit_vmode },
107 static const size_t nkeyslen = LEN(nkeys);
108 static const size_t vkeyslen = LEN(vkeys);
110 /* permissions */
111 static const mode_t ndir_perm = S_IRWXU;
112 static const mode_t nf_perm = S_IRUSR | S_IWUSR;
114 /* scroll */
115 static const int scrmv = 10; /* ctrl+u, ctrl+d movement */
116 static const int scrsp = 3; /* space before scroll */
118 /* statusbar */
119 static const char dtfmt[] = "%F %R"; /* date time format */
121 /* unicode chars */
122 #define u_hl 0x2500 /* ─ */
123 #define u_vl 0x2502 /* │ */
124 #define u_cnw 0x250C /* ┌ */
125 #define u_cne 0x2510 /* ┐ */
126 #define u_csw 0x2514 /* └ */
127 #define u_cse 0x2518 /* ┘ */
128 #define u_mn 0x252C /* ┬ */
129 #define u_ms 0x2534 /* ┴ */
131 #endif /* CONFIG_H */