1DHEXRC(5) BSD File Formats Manual DHEXRC(5)
2
4 dhexrc — Configuration File for dhex
5
7 dhexrc is the configuration file that specifies the colorscheme and the
8 key translation tab for dhex(1), Upon starting the program, it is being
9 read and parsed. It is being written and/or created after invoking the
10 keyboard setup.
11
12 EXAMPLE
13 A typical .dhexrc file looks like this:
14 ‘#DHEXCOLORSCHEME’
15 ‘#VERSION 0’
16 ‘#possible colors are: BLACK,RED,GREEN,YELLOW,BLUE,MAGENTA,CYAN,WHITE’
17 ‘#possible extra flags are: UNDERLINE,REVERSE,BLINK,DIM,BOLD’
18 ‘BRACKETS: FG=BLACK,BG=BLACK,BOLD’
19 ‘HEXFIELD: FG=WHITE,BG=BLACK’
20 ‘INPUT: FG=BLACK,BG=WHITE’
21 ‘CURSOR: FG=WHITE,BG=BLACK’
22 ‘TEXT: FG=WHITE,BG=BLACK,BOLD’
23 ‘MENU_NORMAL: FG=CYAN,BG=BLACK’
24 ‘MENU_HIGHLIGHT: FG=BLACK,BG=CYAN’
25 ‘MENU_HOTKEY: FG=YELLOW,BG=BLACK,BOLD’
26 ‘MENU_HOTKEY_HI: FG=YELLOW,BG=CYAN,BOLD’
27 ‘FRAME: FG=BLUE,BG=BLACK,BOLD’
28 ‘NORMAL_DIFF: FG=YELLOW,BG=BLACK’
29 ‘CURSOR_DIFF: FG=YELLOW,BG=WHITE,BOLD’
30 ‘HEADLINE: FG=BLUE,BG=BLACK,BOLD’
31 ‘HEADER: FG=BLACK,BG=CYAN’
32 ‘KEYF1:1b 5b 31 31 7e’
33 ‘KEYF2:1b 5b 31 32 7e’
34 ‘KEYF3:1b 5b 31 33 7e’
35 ‘KEYF4:1b 5b 31 34 7e’
36 ‘KEYF5:1b 5b 31 35 7e’
37 ‘KEYF6:1b 5b 31 37 7e’
38 ‘KEYF7:1b 5b 31 38 7e’
39 ‘KEYF8:1b 5b 31 39 7e’
40 ‘KEYF9:1b 5b 32 30 7e’
41 ‘KEYF10:1b 5b 32 31 7e’
42 ‘KEYESC:1b’
43 ‘KEYBACKSPACE:08’
44 ‘KEYDEL:7f’
45 ‘KEYENTER:0a’
46 ‘KEYTAB:09’
47 ‘KEYUP:1b 5b 41’
48 ‘KEYDOWN:1b 5b 42’
49 ‘KEYRIGHT:1b 5b 43’
50 ‘KEYLEFT:1b 5b 44’
51 ‘KEYPGUP:1b 5b 35 7e’
52 ‘KEYPGDOWN:1b 5b 36 7e’
53 ‘KEYHOME:1b 5b 37 7e’
54 ‘KEYEND:1b 5b 38 7e’
55
57 In the example above, the dhexrc file has three distinct sections: A com‐
58 ment section, a color section and a key conversion tab section.
59
60 Comments
61 Comments are indicated with a '#' character. Everything afterwards in a
62 line is being ignored when parsing the file
63
64 Color section
65 There are 14 color groups. Each of the color group has a foreground
66 color, a background color and some extra flags, coming from ncurses. The
67 foreground color is being defined by FG= while the background color is
68 being defined by BG=. They and the extra flags are being separated by
69 ','. Possible colors are BLACK, GREEN, RED, YELLOW, BROWN, BLUE, MAGENTA,
70 WHITE, and exclusively as foreground colors LIGHTBLACK, LIGHTGREEN,
71 LIGHTRED, LIGHTYELLOW, LIGHTBROWN, LIGHTBLUE, LIGHTMAGENTA and
72 LIGHTWHITE. Valid extra flags are UNDERLINE, REVERSE, BLINK, DIM and
73 BOLD.
74
75 The color pairs are as followed:
76
77 BRACKETS:
78 This specifies the color for the brackets around text fields.
79
80 HEXFIELD:
81 This specifies the color in which the file's content is being shown.
82
83 INPUT:
84 When entering text, it is in this color.
85
86 CURSOR:
87 The cursor in the hex field has this color.
88
89 TEXT:
90 This color is for informative text as well as for text fields which
91 are not taking input yet.
92
93 MENU_NORMAL:
94 Menu items which are not selected belong into this color group.
95
96 MENU_HIGHLIGHT:
97 The selected menu item gets this special color.
98
99 MENU_HOTKEY:
100 Hotkeys for menu items are visually distinct from the rest of the
101 text because they have this color.
102
103 MENU_HOTKEY_HI:
104 If the actual menu item has a hotkey, it is shown in this color.
105
106 FRAME:
107 Some screens have frames. Those frames have this color.
108
109 NORMAL_DIFF:
110 Differences in the file's content (either because of changes or
111 because dhex is running in diff mode) are indicated by this color.
112
113 CURSOR_DIFF:
114 If the cursor is on one of those differences, it will have this
115 color.
116
117 HEADLINE:
118 On top of the screen, there is a headline. Which is shown in this
119 color.
120
121 HEADER:
122 In the headline, there are brackets. Within those brackets is the
123 header. It tells you what the window is all about.
124
125 Key conversion tab section
126 When pressing a "standard" key, something which can be mapped directly to
127 an ascii character, only this character will end up in ncurses' buffer.
128 However, pressing special keys like (for example) F1 or ALT+6 will pro‐
129 duce longer sequences. Mapping those sequences back to a specific key is
130 the job of the key conversion tab. (I was dissatisfied how ncurses han‐
131 dled this on its own). The sequences are called (in order) KEYF1, KEYF2,
132 KEYF3, KEYF4, KEYF5, KEYF6, KEYF7, KEYF8, KEYF9, KEYF10, KEYESC,
133 KEYBACKSPACE, KEYDEL, KEYENTER, KEYTAB, KEYUP, KEYDOWN, KEYRIGHT,
134 KEYLEFT, KEYPGUP, KEYPGDOWN, KEYHOME and KEYEND.
135
136 Sequences itself are a string of lower case hex-values, each two nibbles
137 long. Currently, there is no way of adding an alternative sequence to the
138 same key.
139
140 It is possible that the sequence made up of hex values does not REALLY
141 belong to the key. (For example if F2 was pressed in the setup program
142 when F1 was prompted). However, when this sequence ends up in the
143 ncurses buffer, it is being interpreted as if that key was pressed.
144
146 Report bugs to <dettus@dettus.net>. Make sure to include DHEX somewhere
147 in the subject.
148
150 Written by Thomas Dettbarn
151
153 dhex(1), dhex_markers(5), dhex_searchlog(5)
154
155BSD May 12, 2012 BSD