aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/aerc.conf6
-rw-r--r--config/ui.go14
2 files changed, 20 insertions, 0 deletions
diff --git a/config/aerc.conf b/config/aerc.conf
index 5f58ceb2..43d17727 100644
--- a/config/aerc.conf
+++ b/config/aerc.conf
@@ -125,6 +125,12 @@
# Default: true
#new-message-bell=true
+#
+# Template to use for Account tab titles
+#
+# Default: {{.Account}}
+#tab-title-account={{.Account}}
+
# Marker to show before a pinned tab's name.
#
# Default: `
diff --git a/config/ui.go b/config/ui.go
index 5f51140c..1b4c35fb 100644
--- a/config/ui.go
+++ b/config/ui.go
@@ -6,6 +6,7 @@ import (
"regexp"
"strconv"
"strings"
+ "text/template"
"time"
"git.sr.ht/~rjarry/aerc/lib/templates"
@@ -72,6 +73,9 @@ type UIConfig struct {
ReverseThreadOrder bool `ini:"reverse-thread-order"`
SortThreadSiblings bool `ini:"sort-thread-siblings"`
+ // Tab Templates
+ TabTitleAccount *template.Template `ini:"-"`
+
// private
contextualUis []*UiConfigContext
contextualCounts map[uiContextType]int
@@ -102,6 +106,7 @@ func defaultUiConfig() *UIConfig {
name, _ := templates.ParseTemplate("column-name", "{{index (.From | names) 0}}")
flags, _ := templates.ParseTemplate("column-flags", `{{.Flags | join ""}}`)
subject, _ := templates.ParseTemplate("column-subject", "{{.Subject}}")
+ tabTitleAccount, _ := templates.ParseTemplate("tab-title-account", "{{.Account}}")
return &UIConfig{
IndexFormat: "", // deprecated
IndexColumns: []*ColumnDef{
@@ -144,6 +149,7 @@ func defaultUiConfig() *UIConfig {
MouseEnabled: false,
ClientThreadsDelay: 50 * time.Millisecond,
NewMessageBell: true,
+ TabTitleAccount: tabTitleAccount,
FuzzyComplete: false,
Spinner: "[..] , [..] , [..] , [..] , [..], [..] , [..] , [..] ",
SpinnerDelimiter: ",",
@@ -336,6 +342,14 @@ func (config *UIConfig) parse(section *ini.Section) error {
}
config.IndexColumns = columns
}
+ if key, err := section.GetKey("tab-title-account"); err == nil {
+ val := key.Value()
+ tmpl, err := templates.ParseTemplate("tab-title-account", val)
+ if err != nil {
+ return err
+ }
+ config.TabTitleAccount = tmpl
+ }
return nil
}