mirror of
https://github.com/miguelmota/cointop
synced 2024-11-10 13:10:26 +00:00
Hide open shortcut in statusbar if no open command found
This commit is contained in:
parent
52496b87fb
commit
f1da2dcb40
@ -41,3 +41,8 @@ func URL(s string) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// CommandExists returns true if an 'open' command exists
|
||||
func CommandExists() bool {
|
||||
return openCmd != ""
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user