feat: Reworked configuration

- Added colors.aliases table
- Colors can also be defined with aliases
- Event color is calculated with priorities
- Added paths table
- Renamed log_path as paths.logs
- Renamed colors.background_text as colors.text
- Added colors.fallback field
- Default values are now taken from source config.toml on compilation
This commit is contained in:
Alexey 2026-04-10 18:54:19 +03:00
commit ba7bc67b6c
13 changed files with 347 additions and 256 deletions

View file

@ -1,53 +1,50 @@
# This is the default config for Aliveline.
# Note: All colors are of format 0xAARRGGBB
# Default Aliveline config
# Path where logs are saved. May be relative to config dir or absolute.
log_path = "logs"
# Paths may be relative to config directory or absolute
[paths]
logs = "logs"
# Colors used for events. For now Aliveline expects to have exactly 16 colors, but this is subject to change in future.
event_colors = [
0xff_97f9f9,
0xff_a4def9,
0xff_c1e0f7,
0xff_cfbae1,
0xff_c59fc9,
0xff_4e3d42,
0xff_c9d5b5,
0xff_2d82b7,
0xff_556f44,
0xff_772e25,
0xff_c44536,
0xff_7c6a0a,
0xff_babd8d,
0xff_ffdac6,
0xff_fa9500,
0xff_eb6424
]
# Colors may be defined either as alias (string) or as 0xAARRGGBB (integer)
# Colors used for event colors. Aliveline expects it to have same size as events.
text_colors = [
0xff_000000,
0xff_000000,
0xff_000000,
0xff_000000,
0xff_000000,
0xff_ffffff,
0xff_000000,
0xff_000000,
0xff_000000,
0xff_ffffff,
0xff_000000,
0xff_000000,
0xff_000000,
0xff_000000,
0xff_000000,
0xff_000000
]
# Aliases must be declared here, otherwise fallback color is used
[colors.aliases]
background = 0xFF_808080
timeline = 0xFF_A9A9A9
black = 0xFF_000000
white = 0xFF_FFFFFF
"very aggressive pink color to use with fallback so you definitely notice it" = 0xFF_FF00E7
[colors]
# Color behind the timeline
background = 0xFF_808080
# Color of the base timeline
timeline = 0xFF_a9a9a9
# Color of background text (timestamps, event names, etc.)
background_text = 0xFF_000000
# Timeline background
background = "background"
# Timeline foreground
timeline = "timeline"
# Background text (timestamps, event names, etc.)
text = "black"
# Used when alias was not found
fallback = "very aggressive pink color to use with fallback so you definitely notice it"
# Event colors are chosen pseudorandomly from this array, respecting each color's priority
# Event color consists of:
# - Background color (default: black)
# - Text color (default: same as colors.text)
# - Priority (default: 1)
# Full example: { background = "color", text = "color", priority = 1337 }
events = [
{ background = 0xff_97f9f9 },
{ background = 0xff_a4def9 },
{ background = 0xff_c1e0f7 },
{ background = 0xff_cfbae1 },
{ background = 0xff_c59fc9 },
{ background = 0xff_4e3d42, text = "white" },
{ background = 0xff_c9d5b5 },
{ background = 0xff_2d82b7 },
{ background = 0xff_556f44 },
{ background = 0xff_772e25, text = "white" },
{ background = 0xff_c44536 },
{ background = 0xff_7c6a0a },
{ background = 0xff_babd8d },
{ background = 0xff_ffdac6 },
{ background = 0xff_fa9500 },
{ background = 0xff_eb6424 },
]