From 8fa1c6d596311e504f90b22662c5b33223292cc7 Mon Sep 17 00:00:00 2001 From: eleksir Date: Sat, 12 Jul 2025 12:41:13 +0300 Subject: [PATCH] Allow to override (in config) color and font settings for AppButtons block --- internal/lib/config.go | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/internal/lib/config.go b/internal/lib/config.go index 22a9c03..8355b99 100644 --- a/internal/lib/config.go +++ b/internal/lib/config.go @@ -1576,6 +1576,21 @@ func ReadConf(defaultConfig []byte) (*MyConfig, error) { } // sampleConfig.AppButtons.Enabled will false if not set in config + if sampleConfig.AppButtons.Color == "" { + sampleConfig.AppButtons.Color = sampleConfig.Color + } + + if sampleConfig.AppButtons.Background == "" { + sampleConfig.AppButtons.Background = sampleConfig.Background + } + + if sampleConfig.AppButtons.Font == "" { + sampleConfig.AppButtons.Font = sampleConfig.Font + } + + if sampleConfig.AppButtons.FontSize == "" { + sampleConfig.AppButtons.FontSize = sampleConfig.FontSize + } if sampleConfig.AppButtons.Separator.Left.Color == "" { sampleConfig.AppButtons.Separator.Left.Color = sampleConfig.Separator.Left.Color @@ -1676,23 +1691,24 @@ func ReadConf(defaultConfig []byte) (*MyConfig, error) { // app.Args can be empty slice. In that case command will be run without aruments. if app.Cmd == "" { + // If command omitted it will be just /usr/bin/true. app.Cmd = "true" } if app.Color == "" { - app.Color = sampleConfig.Color + app.Color = sampleConfig.AppButtons.Color } if app.Background == "" { - app.Background = sampleConfig.Background + app.Background = sampleConfig.AppButtons.Background } if app.Border == "" { - app.Border = sampleConfig.Color + app.Border = sampleConfig.AppButton.Color } if app.BorderActive == "" { - app.BorderActive = sampleConfig.Color + app.BorderActive = sampleConfig.AppButton.Color } // app.Separator can be omitted, in that case it is false