diff options
author | Reto Brunner <reto@labrat.space> | 2020-07-30 23:22:32 +0200 |
---|---|---|
committer | Reto Brunner <reto@labrat.space> | 2020-07-30 23:22:32 +0200 |
commit | 3d784c5d8c7d037e38159fc1753773a2e81aa43e (patch) | |
tree | 2c062c9f4b4641a59e3f4f3ff3317f636bfd49cf /commands | |
parent | 6ee7b1c3fd40b0e2f93dcaa7ffb3b0bdd56ac285 (diff) | |
download | aerc-3d784c5d8c7d037e38159fc1753773a2e81aa43e.tar.gz |
Revert "Implement style configuration."
This reverts commit 1ff687ca2b0821c2cacc1fa725abb3302d2af9da.
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 148442b..2b633dc 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 b48159d..e8b07ed 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 7d24fdc..e15afbe 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 4e4ba67..20cb8b4 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) } } |