diff --git a/cointop/common/open/open.go b/cointop/common/open/open.go index b8108e9..74f3efa 100644 --- a/cointop/common/open/open.go +++ b/cointop/common/open/open.go @@ -41,3 +41,8 @@ func URL(s string) error { } return nil } + +// CommandExists returns true if an 'open' command exists +func CommandExists() bool { + return openCmd != "" +} diff --git a/cointop/statusbar.go b/cointop/statusbar.go index 07314a1..79286cb 100644 --- a/cointop/statusbar.go +++ b/cointop/statusbar.go @@ -3,6 +3,7 @@ package cointop import ( "fmt" + "github.com/miguelmota/cointop/cointop/common/open" "github.com/miguelmota/cointop/cointop/common/pad" ) @@ -44,7 +45,14 @@ func (ct *Cointop) updateStatusbar(s string) error { return nil } -func (ct *Cointop) refreshRowLink() { +func (ct *Cointop) refreshRowLink() error { + var shortcut string + if !open.CommandExists() { + shortcut = "[O]Open " + } + url := ct.rowLinkShort() - ct.updateStatusbar(fmt.Sprintf("%sOpen %s", "[O]", url)) + ct.updateStatusbar(fmt.Sprintf("%s%s", shortcut, url)) + + return nil }