aboutsummaryrefslogtreecommitdiffstats
path: root/config/style.go
Commit message (Collapse)AuthorAgeFilesLines
* filters: rewrite colorize in cRobin Jarry2023-01-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since its introduction, we had multiple issues with the colorize awk script with regard to non-GNU awk compatibility. Also, this script is standalone and the color theme must be hard coded into it. Reading from an external configuration file (aerc's styleset) from a non-GNU awk is close to impossible (and even far from trivial with GNU awk). Rewrite the builtin colorize filter in C to allow getting the color theme from aerc's active styleset. The theme is configured using the existing styleset syntax and attributes under a separate [viewer] section (see examples and man page). Export the active styleset file path to AERC_STYLESET env var when invoking the filter command so that colorize can access it and use it. I have tested compilation (with clang-analyzer and gcc -fanalyzer) and basic operation on FreeBSD, Fedora (glibc) and Alpine (muslibc). More tests would probably be required on MacOSX and older Linux distros. I also added test vectors to give some confidence that this works as expected. The execution with these vectors passed valgrind --leak-check=full without errors. NB: the default theme has changed to be more minimal. Sample stylesets have more colorful examples. The awk -v theme=xxx option is no longer supported. usage: colorize [-h] [-s FILE] [-f FILE] options: -h show this help message -s FILE use styleset file (default $AERC_STYLESET) -f FILE read from filename (default stdin) Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* stylesets: add support for dim textRobin Jarry2023-01-261-1/+13
| | | | | | | Allow defining <obj>.dim=true to turn on half-bright text. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
* style: add msglist_answered config optionMartin Lucina2023-01-101-7/+9
| | | | | | | | Add a style for messages that have been marked as answered, and a "msglist_answered" config option for it. Signed-off-by: Martin Lucina <martin@lucina.net> Acked-by: Robin Jarry <robin@jarry.cc>
* style: add italic optionTim Culverhouse2022-11-091-1/+13
| | | | | | | | Add italic option to style config. Update docs. Suggested-by: inwit <inwit@sindominio.net> Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
* msglist: style search resultsTim Culverhouse2022-11-061-0/+2
| | | | | | | | Add option to style search results in the message list. Set default style for results. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* status: add warning style and methodsTim Culverhouse2022-11-061-0/+2
| | | | | | | | Add a warning style to default statusline. Add methods to status, aerc, and account to push a warning message. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* lint: apply new formatting rulesMoritz Poldrack2022-08-011-1/+2
| | | | | | | Run `make fmt`. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
* style: add style config options for dirlist_unread and dirlist_recentTim Culverhouse2022-04-271-0/+4
| | | | | | | | Adds two style options: dirlist_unread and dirlist_recent. These options apply in layers, in the same way as msglist_* styles do. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
* stylesets: allow specifying color by numberTobias Wölfel2022-04-071-2/+14
| | | | | | | | | Make it possible to specify the color in the style sets by number in addition to the color name. This allows using colors defined by the terminal. Signed-off-by: Tobias Wölfel <tobias.woelfel@mailbox.org> Acked-by: Robin Jarry <robin@jarry.cc>
* update tcell to v2 and enable TrueColor supporty0ast2020-12-181-1/+1
| | | | | | | | | Also update to the tcell v2 PaletteColor api, which should keep the chosen theme of the user intact. Note, that if $TRUECOLOR is defined and a truecolor given, aerc will now stop clipping the value to one of the theme colors. Generally this is desired behaviour though.
* Apply relevant msglist styles in orderChris Vittal2020-11-011-2/+48
| | | | | | | | | | | | | | | | | | Allow styles to be layered over a base style. The list of styles to apply is layered over the base style in order, such that if the layer does not differ from the base it is not used. The order that these styles are applied in is, from first to last: msglist_default msglist_unread msglist_read (exclusive with unread, so technically the same level) msglist_flagged msglist_deleted msglist_marked So, msglist_marked style dominates. This fixes an issue where the msglist_deleted style was not being applied.
* correct tcell.Style for underlinesqwishy2020-08-291-1/+1
|
* stylesets: only accept comment char after whitespaceThorben Günther2020-08-071-1/+4
| | | | | | Without the option SpaceBeforeInlineComment set, go-ini will parse just a single " This lead to people being unable to specify hex color codes
* Implement style configuration.Kalyan Sriram2020-08-061-0/+379
| | | | | | Introduce the ability to configure stylesets, allowing customization of aerc's look (color scheme, font weight, etc). Default styleset is installed to /path/to/aerc/stylesets/default.
* Revert "Implement style configuration."Reto Brunner2020-07-301-379/+0
| | | | This reverts commit 1ff687ca2b0821c2cacc1fa725abb3302d2af9da.
* Implement style configuration.Kalyan Sriram2020-07-301-0/+379
| | | | | | Introduce the ability to configure stylesets, allowing customization of aerc's look (color scheme, font weight, etc). Default styleset is installed to /path/to/aerc/stylesets/default.
* Revert "Add Style configuration"Drew DeVault2020-05-281-372/+0
| | | | This reverts commit 0f78f06610c0e8887aba2ae50e99b86477a384b3.
* Add Style configurationReto Brunner2020-05-271-0/+372
The following functionalities are added to configure aerc ui styles. - Read stylesets from file with very basic fnmatch wildcard matching - Add default styleset - Support different stylesets as part of UiConfig allowing contextual styles. - Move widgets/ui elements to use the stylesets. - Add configuration manual for the styleset