diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/compose/attach.go | 5 | ||||
-rw-r--r-- | commands/compose/detach.go | 5 | ||||
-rw-r--r-- | commands/exec.go | 15 | ||||
-rw-r--r-- | commands/msg/pipe.go | 14 |
4 files changed, 23 insertions, 16 deletions
diff --git a/commands/compose/attach.go b/commands/compose/attach.go index 148442b0..2b633dc6 100644 --- a/commands/compose/attach.go +++ b/commands/compose/attach.go @@ -4,9 +4,11 @@ import ( "fmt" "os" "strings" + "time" "git.sr.ht/~sircmpwn/aerc/commands" "git.sr.ht/~sircmpwn/aerc/widgets" + "github.com/gdamore/tcell" "github.com/mitchellh/go-homedir" ) @@ -50,7 +52,8 @@ func (Attach) Execute(aerc *widgets.Aerc, args []string) error { composer, _ := aerc.SelectedTab().(*widgets.Composer) composer.AddAttachment(path) - aerc.PushSuccess(fmt.Sprintf("Attached %s", pathinfo.Name())) + aerc.PushStatus(fmt.Sprintf("Attached %s", pathinfo.Name()), 10*time.Second). + Color(tcell.ColorDefault, tcell.ColorGreen) return nil } diff --git a/commands/compose/detach.go b/commands/compose/detach.go index b48159d0..e8b07ed6 100644 --- a/commands/compose/detach.go +++ b/commands/compose/detach.go @@ -3,8 +3,10 @@ package compose import ( "fmt" "strings" + "time" "git.sr.ht/~sircmpwn/aerc/widgets" + "github.com/gdamore/tcell" ) type Detach struct{} @@ -42,7 +44,8 @@ func (Detach) Execute(aerc *widgets.Aerc, args []string) error { return err } - aerc.PushSuccess(fmt.Sprintf("Detached %s", path)) + aerc.PushStatus(fmt.Sprintf("Detached %s", path), 10*time.Second). + Color(tcell.ColorDefault, tcell.ColorGreen) return nil } diff --git a/commands/exec.go b/commands/exec.go index 7d24fdc1..e15afbe9 100644 --- a/commands/exec.go +++ b/commands/exec.go @@ -7,6 +7,8 @@ import ( "time" "git.sr.ht/~sircmpwn/aerc/widgets" + + "github.com/gdamore/tcell" ) type ExecCmd struct{} @@ -33,15 +35,14 @@ func (ExecCmd) Execute(aerc *widgets.Aerc, args []string) error { if err != nil { aerc.PushError(" " + err.Error()) } else { + color := tcell.ColorDefault if cmd.ProcessState.ExitCode() != 0 { - aerc.PushError(fmt.Sprintf( - "%s: completed with status %d", args[0], - cmd.ProcessState.ExitCode())) - } else { - aerc.PushStatus(fmt.Sprintf( - "%s: completed with status %d", args[0], - cmd.ProcessState.ExitCode()), 10*time.Second) + color = tcell.ColorRed } + aerc.PushStatus(fmt.Sprintf( + "%s: completed with status %d", args[0], + cmd.ProcessState.ExitCode()), 10*time.Second). + Color(tcell.ColorDefault, color) } }() return nil diff --git a/commands/msg/pipe.go b/commands/msg/pipe.go index 4e4ba67d..20cb8b46 100644 --- a/commands/msg/pipe.go +++ b/commands/msg/pipe.go @@ -12,6 +12,7 @@ import ( "git.sr.ht/~sircmpwn/aerc/worker/types" "git.sr.ht/~sircmpwn/getopt" + "github.com/gdamore/tcell" ) type Pipe struct{} @@ -95,15 +96,14 @@ func (Pipe) Execute(aerc *widgets.Aerc, args []string) error { if err != nil { aerc.PushError(" " + err.Error()) } else { + color := tcell.ColorDefault if ecmd.ProcessState.ExitCode() != 0 { - aerc.PushError(fmt.Sprintf( - "%s: completed with status %d", cmd[0], - ecmd.ProcessState.ExitCode())) - } else { - aerc.PushStatus(fmt.Sprintf( - "%s: completed with status %d", cmd[0], - ecmd.ProcessState.ExitCode()), 10*time.Second) + color = tcell.ColorRed } + aerc.PushStatus(fmt.Sprintf( + "%s: completed with status %d", cmd[0], + ecmd.ProcessState.ExitCode()), 10*time.Second). + Color(tcell.ColorDefault, color) } } |