owl: 1 config: make all message list symbols/icons configurable 3 files changed, 42 insertions(+), 6 deletions(-)
Bence Ferdinandy, Sep 16, 2023 at 23:42:
Copy & paste the following snippet into your terminal to import this patchset into git:
curl -s https://lists.sr.ht/~rjarry/aerc-devel/patches/44784/mbox | git am -3Learn more about email & git
This patch removes the hardcoded letters (which don't make sense in all languages), and replaces them with configurable icons, like the existing `icon-attachment` and other icons. Signed-off-by: owl <owl@u8.is> ---
This is a good idea I think :) Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>Acked-by: Robin-Jarry <robin@jarry.cc> I have renamed the settings to make them consistent with other icon-* stuff. Applied. Thanks!-- +36305425054 bence.ferdinandy.com
config/ui.go | 6 ++++++ doc/aerc-config.5.scd | 30 ++++++++++++++++++++++++++++++ lib/state/templates.go | 12 ++++++------ 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/config/ui.go b/config/ui.go index 699e8a0..ab5a34e 100644 --- a/config/ui.go +++ b/config/ui.go @@ -53,6 +53,12 @@ type UIConfig struct { IconUnknown string `ini:"icon-unknown" default:"[s?]"` IconInvalid string `ini:"icon-invalid" default:"[s!]"` IconAttachment string `ini:"icon-attachment" default:"a"` + IconMessageReplied string `ini:"icon-message-replied" default:"r"` + IconMessageNew string `ini:"icon-message-new" default:"N"` + IconMessageOld string `ini:"icon-message-old" default:"O"` + IconFlagged string `ini:"icon-flagged" default:"!"` + IconMarked string `ini:"icon-marked" default:"*"` + IconDeleted string `ini:"icon-deleted" default:"D"` DirListDelay time.Duration `ini:"dirlist-delay" default:"200ms"` DirListTree bool `ini:"dirlist-tree"` DirListCollapse int `ini:"dirlist-collapse"` diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd index b09ce53..76efcd2 100644 --- a/doc/aerc-config.5.scd +++ b/doc/aerc-config.5.scd @@ -349,6 +349,36 @@ These options are configured in the *[ui]* section of _aerc.conf_. Default: _a_ +*icon-message-new* = _<string>_ + The icon to display index-format when the message is unread and new. + + Default: _N_ + +*icon-message-old* = _<string>_ + The icon to display index-format when the message is unread and old. + + Default: _O_ + +*icon-message-replied* = _<string>_ + The icon to display index-format when the message has been replied to. + + Default: _r_ + +*icon-flagged* = _<string>_ + The icon to display index-format when the message is flagged. + + Default: _!_ + +*icon-marked* = _<string>_ + The icon to display index-format when the message is marked. + + Default: _\*_ + +*icon-deleted* = _<string>_ + The icon to display index-format when the message has been deleted. + + Default: _D_ + *fuzzy-complete* = _true_|_false_ When typing a command or option, the popover will now show not only the items /starting/ with the string input by the user, but it will also show diff --git a/lib/state/templates.go b/lib/state/templates.go index 22d0658..5ce440d 100644 --- a/lib/state/templates.go +++ b/lib/state/templates.go @@ -345,16 +345,16 @@ func (d *templateData) Flags() []string { switch { case d.info.Flags.Has(models.SeenFlag | models.AnsweredFlag): - flags = append(flags, "r") // message has been replied to + flags = append(flags, d.ui().IconMessageReplied) // message has been replied to case d.info.Flags.Has(models.SeenFlag): break case d.info.Flags.Has(models.RecentFlag): - flags = append(flags, "N") // message is new + flags = append(flags, d.ui().IconMessageNew) // message is new default: - flags = append(flags, "O") // message is old + flags = append(flags, d.ui().IconMessageOld) // message is old } if d.info.Flags.Has(models.DeletedFlag) { - flags = append(flags, "D") + flags = append(flags, d.ui().IconDeleted) } if d.info.BodyStructure != nil { for _, bS := range d.info.BodyStructure.Parts { @@ -365,10 +365,10 @@ func (d *templateData) Flags() []string { } } if d.info.Flags.Has(models.FlaggedFlag) { - flags = append(flags, "!") + flags = append(flags, d.ui().IconFlagged) } if d.marked { - flags = append(flags, "*") + flags = append(flags, d.ui().IconMarked) } return flags } -- 2.42.0
builds.sr.ht <builds@sr.ht>aerc/patches: SUCCESS in 4m42s [config: make all message list symbols/icons configurable][0] from [owl][1] [0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/44784 [1]: mailto:owl@u8.is ✓ #1058316 SUCCESS aerc/patches/openbsd.yml https://builds.sr.ht/~rjarry/job/1058316 ✓ #1058315 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1058315