From 0f78f06610c0e8887aba2ae50e99b86477a384b3 Mon Sep 17 00:00:00 2001 From: Reto Brunner Date: Wed, 27 May 2020 07:37:02 +0200 Subject: Add Style configuration 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 --- commands/msg/pipe.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'commands/msg/pipe.go') diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go index c88d61f..15b8c52 100644 --- a/commands/msg/pipe.go +++ b/commands/msg/pipe.go @@ -12,7 +12,6 @@ import ( "git.sr.ht/~sircmpwn/aerc/worker/types" "git.sr.ht/~sircmpwn/getopt" - "github.com/gdamore/tcell" ) type Pipe struct{} @@ -76,7 +75,7 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error { doTerm := func(reader io.Reader, name string) { term, err := commands.QuickTerm(aerc, cmd, reader) if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(" "+err.Error(), 10*time.Second) return } aerc.NewTab(term, name) @@ -94,16 +93,17 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error { }() err = ecmd.Run() if err != nil { - aerc.PushError(" " + err.Error()) + aerc.PushError(" "+err.Error(), 10*time.Second) } else { - color := tcell.ColorDefault if ecmd.ProcessState.ExitCode() != 0 { - color = tcell.ColorRed + aerc.PushError(fmt.Sprintf( + "%s: completed with status %d", cmd[0], + ecmd.ProcessState.ExitCode()), 10*time.Second) + } else { + aerc.PushStatus(fmt.Sprintf( + "%s: completed with status %d", cmd[0], + ecmd.ProcessState.ExitCode()), 10*time.Second) } - aerc.PushStatus(fmt.Sprintf( - "%s: completed with status %d", cmd[0], - ecmd.ProcessState.ExitCode()), 10*time.Second). - Color(tcell.ColorDefault, color) } } -- cgit 1.4.1-2-gfad0