DHEXRC(5)

πŸ’– DHEXRC β€” the dhex config file, bestie edition πŸ’–

ok so this is the manpage for dhexrc, which is the Configuration File for dhex, and it lives in the LOCAL section, iykyk. πŸŽ€


✨ DESCRIPTION ✨

dhexrc is the config file that holds the colorscheme and the key translation tab for dhex(1). When you start the program, this file gets read and parsed. And it gets written and/or created after you invoke the keyboard setup. so it's giving both read AND write energy, main character file fr fr. πŸ’…

🌸 EXAMPLE 🌸

a typical .dhexrc file looks like this, no cap:

#DHEXCOLORSCHEME
#VERSION 0
#possible colors are: BLACK,RED,GREEN,YELLOW,BLUE,MAGENTA,CYAN,WHITE
#possible extra flags are: UNDERLINE,REVERSE,BLINK,DIM,BOLD
BRACKETS: FG=BLACK,BG=BLACK,BOLD
HEXFIELD: FG=WHITE,BG=BLACK
INPUT: FG=BLACK,BG=WHITE
CURSOR: FG=WHITE,BG=BLACK
TEXT: FG=WHITE,BG=BLACK,BOLD
MENU_NORMAL: FG=CYAN,BG=BLACK
MENU_HIGHLIGHT: FG=BLACK,BG=CYAN
MENU_HOTKEY: FG=YELLOW,BG=BLACK,BOLD
MENU_HOTKEY_HI: FG=YELLOW,BG=CYAN,BOLD
FRAME: FG=BLUE,BG=BLACK,BOLD
NORMAL_DIFF: FG=YELLOW,BG=BLACK
CURSOR_DIFF: FG=YELLOW,BG=WHITE,BOLD
HEADLINE: FG=BLUE,BG=BLACK,BOLD
HEADER: FG=BLACK,BG=CYAN
KEYF1:1b 5b 31 31 7e
KEYF2:1b 5b 31 32 7e
KEYF3:1b 5b 31 33 7e
KEYF4:1b 5b 31 34 7e
KEYF5:1b 5b 31 35 7e
KEYF6:1b 5b 31 37 7e
KEYF7:1b 5b 31 38 7e
KEYF8:1b 5b 31 39 7e
KEYF9:1b 5b 32 30 7e
KEYF10:1b 5b 32 31 7e
KEYESC:1b
KEYBACKSPACE:08
KEYDEL:7f
KEYENTER:0a
KEYTAB:09
KEYUP:1b 5b 41
KEYDOWN:1b 5b 42
KEYRIGHT:1b 5b 43
KEYLEFT:1b 5b 44
KEYPGUP:1b 5b 35 7e
KEYPGDOWN:1b 5b 36 7e
KEYHOME:1b 5b 37 7e
KEYEND:1b 5b 38 7e

🌈 OPTIONS 🌈

in that example up there ☝️ the dhexrc file has three distinct sections: a comment section, a color section, and a key conversion tab section. three little besties doing different jobs. obsessed. 🫢

πŸ’¬ Comments πŸ’¬

comments are marked with a '#' character. everything after that on the line gets straight-up ignored when the file is being parsed. so go off, write your little notes. πŸ’œ

🎨 Color section 🎨

there are 14 color groups, periodt. each one has a foreground color, a background color, and some extra flags, all coming from ncurses. the foreground color is defined by FG=, and the background color is defined by BG=. those and the extra flags are separated by ','.

the possible colors are BLACK, GREEN, RED, YELLOW, BROWN, BLUE, MAGENTA, WHITE, and β€” exclusively as foreground colors β€” LIGHTBLACK, LIGHTGREEN, LIGHTRED, LIGHTYELLOW, LIGHTBROWN, LIGHTBLUE, LIGHTMAGENTA and LIGHTWHITE. πŸ‘‘

valid extra flags are UNDERLINE, REVERSE, BLINK, DIM and BOLD.

the color pairs are as followed:

  • BRACKETS: β€” this specifies the color for the brackets around text fields.
  • HEXFIELD: β€” this specifies the color in which the file's content is being shown.
  • INPUT: β€” when entering text, it is in this color.
  • CURSOR: β€” the cursor in the hex field has this color.
  • TEXT: β€” this color is for informative text as well as for text fields which are not taking input yet.
  • MENU_NORMAL: β€” menu items which are not selected belong into this color group.
  • MENU_HIGHLIGHT: β€” the selected menu item gets this special color. ✨
  • MENU_HOTKEY: β€” hotkeys for menu items are visually distinct from the rest of the text because they have this color.
  • MENU_HOTKEY_HI: β€” if the actual menu item has a hotkey, it is shown in this color.
  • FRAME: β€” some screens have frames. those frames have this color.
  • NORMAL_DIFF: β€” differences in the file's content (either because of changes or because dhex is running in diff mode) are indicated by this color.
  • CURSOR_DIFF: β€” if the cursor is on one of those differences, it will have this color.
  • HEADLINE: β€” on top of the screen, there is a headline. which is shown in this color.
  • HEADER: β€” in the headline, there are brackets. within those brackets is the header. it tells you what the window is all about.

⌨️ Key conversion tab section ⌨️

ok so when you press a "standard" key β€” something which can be mapped directly to an ascii character β€” only this character will end up in ncurses' buffer. simple. iconic.

but the moment you press special keys like (for example) F1 or ALT+6, they produce longer sequences. mapping those sequences back to a specific key is the whole job of the key conversion tab. (the author was dissatisfied how ncurses handled this on its own, and honestly? valid. 😭)

the sequences are called, in order: KEYF1, KEYF2, KEYF3, KEYF4, KEYF5, KEYF6, KEYF7, KEYF8, KEYF9, KEYF10, KEYESC, KEYBACKSPACE, KEYDEL, KEYENTER, KEYTAB, KEYUP, KEYDOWN, KEYRIGHT, KEYLEFT, KEYPGUP, KEYPGDOWN, KEYHOME and KEYEND. πŸŽ€

sequences themselves are a string of lower case hex-values, each two nibbles long. currently, there is no way of adding an alternative sequence to the same key. ngl that's just how it is.

⚠️ also heads up bestie: it is possible that the sequence made up of hex values does not REALLY belong to the key. (for example if F2 was pressed in the setup program when F1 was prompted.) however, when this sequence ends up in the ncurses buffer, it is being interpreted as if that key was pressed. πŸ’€ so like, it commits to the bit.

πŸ› BUGS πŸ›

report bugs to <dettus@dettus.net>. make sure to include DHEX somewhere in the subject. please and thank you. πŸ™ˆ


πŸ‘‘ AUTHOR πŸ‘‘

Written by Thomas Dettbarn.


πŸ”— SEE ALSO πŸ”—

dhex(1), dhex_markers(5), dhex_searchlog(5)


and that's the whole page, bestie πŸ¦‹ this little Debian-flavored gem is dated May 12, 2012 and it belongs to the DHEXRC(5) manual, section LOCAL. go forth and color your terminal, slay πŸ’…βœ¨πŸŒˆ