Configuration File

The configuration file is read from $XDG_CONFIG_HOME/a4/a4.ini by default. If $XDG_CONFIG_HOME is not set, it reads from $HOME/.config/a4/a4.ini. Alternatively, the user can specify the configuration file path using the -i command line parameter. If neither of these is available, the default a4.ini file is read from the installation directory, usually /usr/local/etc/a4/a4.ini.

$ a4 -i ./foo.ini

Annotated a4.ini File

# Any number of actions assigned to the optional special keyword "startup" are
# run when a4 is started, in the order specified.
startup             = create_term
#startup             = view 2
#startup             = create_term
#startup             = keysequence ssh example.com\n
#include             = startup.ini

# The size of the layout zoom area is a number from .1 to .9, and the number of
# terminals in the zoom area is a number 1 or more.
zoomsize            = .5
zoomnum             = 1

# Number of lines saved for each terminal's scroll back history
scroll_history      = 5000

# Colors are specified as -1 for default, 0-7 for standard, 8-15 for bright,
# 16-231 for extended, 232-255 for gray scale, 0xRRGGBB for 24-bit RGB colors,
# or you can use any of the X11 Color Names. Font attributes are optional and
# may be comma separated from bold, italic, reverse, strike, and blink. This
# may also include one of three underline types single, double, or curly.
titlebar_normal     = white    gray66 
titlebar_selected   = white    DeepSkyBlue4 
titlebar_readonly   = red      gray66   ITALIC
titlebar_urgent     = white    gray66   BLINK

# Specify one or more status bar commands to cycle through at the given number
# of interval seconds. Set interval to 0 to have the command run once and not
# refresh. Set interval to -1 to not have any status bar text.
statusbar_cmd       = date
statusbar_cmd       = uptime
#statusbar_cmd       = uptime; echo -n ' │ '; date
#statusbar_cmd       = cat ~/.cache/status/statusbar.txt
statusbar_interval  = 5
statusbar           = white    gray15 
statusbar_display   = true
statusbar_top       = true
#statusbar_begin     = [
#statusbar_end       = ]

# Define up to 9 alphanumeric tag names, how they will be displayed on the
# status bar, and the types of colors and font attributes.
tagnames            = 1 2 3 4 5 6 7 8 9
#tagnames            = play dev test stage prod
tag_printf          = " %s "
tag_normal          = white    gray15 
tag_selected        = white    DeepSkyBlue1 BOLD
tag_occupied        = white    gray66 
tag_urgent          = white    gray66   BLINK

# The terminal cursor can be set to visible or hidden, blinking or solid, and
# the shape can be 1-block, 2-underline, or 3-bar.
cursorvis           = true
cursorblink         = true
cursorshape         = 1

[Layouts]
# Layout symbol string in the status bar. Order of symbols determines layout
# toggle cycle.
zoom_left       = " │├┤ "
zoom_right      = " ├┤│ "
fullscreen      = " │ │ "
grid            = " ├┼┤ "
columns         = " │││ "
rows            = " ─── "
zoom_top        = " ├┬┤ "
zoom_bottom     = " ├┴┤ "

[KeyboardActions]
# Keyboard actions have a key combination of up to three keys assigned to them.
# A key can be on its own or can include the Meta or Alt key, M-, the Control
# key, C-, the Shift key, S-, or with combinations of those. Any modifier keys
# must be put in the order of M-C-S-. Two special keys that must be fully
# spelled out are "Space" and "Hyphen".
C-g c           = create_term
C-g x x         = destroy_term
C-g Enter       = zoom
C-g .           = minimize_tog
C-g q q         = quit_a4
C-g C-l         = redraw
C-g s           = statusbarvis
C-g S           = statusbarpos

# The four actions view, tag, view_tog, and tag_tog each take tag position
# number as a parameter. You can use the '#' character as a shortcut in the
# key combination and the action parameter to assign that combo/action pairing
# to digits 1-9. For the key combination, the last occurrence of '#' is
# replaced with the digit, and the same digit is passed as the action
# parameter. For example, "C-g v # = view #" is expanded out to
# "C-g v 1 = view 1", "C-g v 2 = view 2", .... Likewise, to map function keys
# to view, "C-g F# = view #" is expanded out to "C-g F1 = view 1",
# "C-g F2 = view 2", ....
C-g v #         = view #
C-g F#          = view #
C-g t #         = tag #
C-g V #         = view_tog #
C-g T #         = tag_tog #

# View all tags
C-g v 0         = view
# View previous tag
C-g v Tab       = viewprevtag
# Set all tags for the terminal
C-g t 0         = tag

# The focusn action takes window number as a parameter. You can use the '#'
# character as a shortcut in the key combination and the action parameter to
# assign that combo/action pairing to digits 1-9. For the key combination, the
# last occurrence of '#' is replaced with the digit, and the same digit is
# passed as the action parameter. For example, "C-g # = focusn #" is expanded
# out to "C-g 1 = focusn 1", "C-g 2 = focusn 2", ....
C-g #           = focusn #

C-g j           = focusnext
#C-g J           = focusnextvis
C-g k           = focusprev
#C-g K           = focusprevvis
C-g Tab         = focuslast
C-g H           = focusleft
C-g J           = focusdown
C-g K           = focusup
C-g L           = focusright
C-g 0           = groupedfocus all
C-g )           = groupedfocus
C-g *           = readonly_tog

C-a f           = setlayout fullscreen
C-a g           = setlayout grid
C-a h           = setlayout zoom_left
C-a j           = setlayout zoom_bottom
C-a k           = setlayout zoom_top
C-a l           = setlayout zoom_right
C-a c           = setlayout columns
C-a r           = setlayout rows
# Cycle through all layouts in order listed in the [Layouts] section
C-a Space       = setlayout 1
C-a C-Space     = setlayout -1
C-a Tab         = setlastlayout

C-a i           = setzoomnum +1
C-a d           = setzoomnum -1
C-a I           = setzoomsize +.05
C-a D           = setzoomsize -.05

S-PageUp        = scrollback  .5
S-PageDown      = scrollback -.5
C-g PageUp      = scrollback  1.0
C-g PageDown    = scrollback -1.0

# Specify ANSI escape or other key sequence overrides
#Home            = keysequence \e[1~
#End             = keysequence \e[4~
#include         = vt220.ini
#C-g Space       = keysequence Hello, world!

[MouseTermwinActions]
click-1         = focus_mouse
C-click-1       = groupedfocus_mouse
click-3         = zoom_mouse
wheel-up        = scrollback  3
wheel-dn        = scrollback -3
S-wheel-up      = scrollback  0.5
S-wheel-dn      = scrollback -0.5
C-wheel-up      = scrollback  1.0
C-wheel-dn      = scrollback -1.0

[MouseTitlebarActions]
click-1         = minimize_tog_mouse

[MouseTagActions]
click-1         = view_mouse
C-click-1       = view_tog_mouse
click-3         = tag_mouse
C-click-3       = tag_tog_mouse

[MouseLayoutActions]
click-1         = setlayout 1
click-3         = setlayout -1
C-click-1       = setzoomnum +1
C-click-3       = setzoomnum -1
M-C-click-1     = setzoomsize +.1
M-C-click-3     = setzoomsize -.1

[MouseStatusTextActions]
click-1         = statusnext

[MouseFrameActions]
click-1         = setlayout fullscreen

# First defined colorscheme is used as the default
[ColorScheme Basic]
#color123    = DarkOrange1 
fg          = 7 
bg          = 0 

[ColorScheme BasicRed]
fg          = 0 
bg          = 9 

[ColorScheme Red160]
fg          = 232 
bg          = 160 

[ColorScheme Crimson]
fg          = MidnightBlue 
bg          = Crimson 

[ColorScheme RedSands]
color00     = 0x000000 
color01     = 0xff3f00 
color02     = 0x00bb00 
color03     = 0xe7b000 
color04     = 0x0072ff 
color05     = 0xbb00bb 
color06     = 0x00bbbb 
color07     = 0xbbbbbb 
color08     = 0x555555 
color09     = 0xbb0000 
color10     = 0x00bb00 
color11     = 0xe7b000 
color12     = 0x0072ae 
color13     = 0xff55ff 
color14     = 0x55ffff 
color15     = 0xffffff 
fg          = 0xd7c9a7 
bg          = 0x7a251e 
cursor      = 0xd7c9a7 

#include     = cs_fairyfloss.ini
#include     = cs_gruvbox.ini
#include     = cs_kokuban.ini
#include     = cs_redsands.ini
#include     = cs_solarized.ini

# Color rules pair text with a colorscheme. A terminal window's title bar text
# is compared with each ColorRule text, in the order specified, until one
# matches, and then that colorscheme is applied to the terminal. If none of the
# rules match, then the first colorscheme defined in a4.ini is used.
[ColorRules]
root@           = RedSands
@example        = Crimson
        

https://waxandwane.org