From 320aa2257f5b5f4ef516eccc3ab2bd49b79d0fdb Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Mon, 11 Sep 2023 17:52:47 +0200 Subject: config: add default values for empty stylesets When adding new style objects it is impossible to give them a default color nor attributes without modifying each existing user styleset. Also, if the user has an incomplete styleset, some parts of aerc will have no style at all. These quirks are not nice from a user experience point of view. Before parsing the user styleset, initialize aerc style with basic defaults. Reuse the exact same content than the actual "default" styleset provided in /usr/share/aerc/stylesets. Comment all of the default styleset to make it obvious that these are default values. This has some implications: * To reset these defaults, the user styleset must now start with these two lines: *.default = true *.normal = true If these two lines are not present, the default style will be kept and only changed if the user styleset explicitly sets them. * Empty stylesets no longer produce weird results. Signed-off-by: Robin Jarry Tested-by: Inwit --- stylesets/blue | 3 +++ stylesets/default | 49 ++++++++++++++++++++++++++----------------------- stylesets/dracula | 3 +++ stylesets/nord | 1 + stylesets/pink | 3 ++- stylesets/solarized | 1 + 6 files changed, 36 insertions(+), 24 deletions(-) (limited to 'stylesets') diff --git a/stylesets/blue b/stylesets/blue index c598ef92..46e04b46 100644 --- a/stylesets/blue +++ b/stylesets/blue @@ -1,5 +1,8 @@ # vim: ft=dosini +*.default=true +*.normal=true + border.bg=#005f87 title.bg=#005f87 diff --git a/stylesets/default b/stylesets/default index f3ea2733..c0d6f909 100644 --- a/stylesets/default +++ b/stylesets/default @@ -6,36 +6,39 @@ # the aerc-stylesets(7) manpage. Please read the manual before # modifying or creating a styleset. -*.default=true -*.selected.reverse=toggle +# Uncomment these two lines to reset all attributes and start from scratch. +#*.default=true +#*.normal=true -title.reverse=true -header.bold=true +#*.selected.reverse=toggle +# +#title.reverse=true +#header.bold=true -*error.bold=true -error.fg=red -warning.fg=yellow -success.fg=green +#*error.bold=true +#error.fg=red +#warning.fg=yellow +#success.fg=green -statusline*.default=true -statusline_default.reverse=true -statusline_error.fg=red -statusline_error.reverse=true -statusline_warning.fg=yellow -statusline_warning.reverse=true +#statusline*.default=true +#statusline_default.reverse=true +#statusline_error.fg=red +#statusline_error.reverse=true +#statusline_warning.fg=yellow +#statusline_warning.reverse=true -msglist_unread.bold=true -msglist_deleted.fg=gray -msglist_result.fg=green -msglist_pill.reverse=true +#msglist_unread.bold=true +#msglist_deleted.fg=gray +#msglist_result.fg=green +#msglist_pill.reverse=true -completion_pill.reverse=true +#completion_pill.reverse=true -tab.reverse=true -border.reverse = true +#tab.reverse=true +#border.reverse = true -selector_focused.reverse=true -selector_chooser.bold=true +#selector_focused.reverse=true +#selector_chooser.bold=true #[viewer] #url.underline=true diff --git a/stylesets/dracula b/stylesets/dracula index 9e24f422..8b8788e9 100644 --- a/stylesets/dracula +++ b/stylesets/dracula @@ -1,3 +1,6 @@ +*.default=true +*.normal=true + #border.bg=#BD93F9 title.bg=#BD93F9 diff --git a/stylesets/nord b/stylesets/nord index f099a43f..e9c7e853 100644 --- a/stylesets/nord +++ b/stylesets/nord @@ -3,6 +3,7 @@ # *.default=true +*.normal=true title.reverse=true header.bold=true diff --git a/stylesets/pink b/stylesets/pink index 1f73d0f7..9fd8c213 100644 --- a/stylesets/pink +++ b/stylesets/pink @@ -1,6 +1,7 @@ # vim: ft=dosini -#de4e85 +*.default=true +*.normal=true border.bg=#de4e85 title.bg=#de4e85 diff --git a/stylesets/solarized b/stylesets/solarized index 026c3755..dcd8606f 100644 --- a/stylesets/solarized +++ b/stylesets/solarized @@ -3,6 +3,7 @@ # *.default=true +*.normal=true *error.bold=true border.reverse=true completion_pill.reverse=true -- cgit