summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-04-23 11:30:54 -0500
committerJeff Carr <[email protected]>2023-04-23 11:30:54 -0500
commit36894c8b38c6ef3a722ef00fa5d3aeddcef5724e (patch)
tree4b927b6123446e850bd10441d137695eba5e68a4 /main.go
parent7d178283f1834ddd01123a5d5d0b160bb8d7234d (diff)
return to normal plugin load order
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/main.go b/main.go
index 9e37080..63cbf42 100644
--- a/main.go
+++ b/main.go
@@ -154,18 +154,20 @@ func New() *Node {
return Config.rootNode
}
+// try to load andlabs, if that doesn't work, fall back to the console
func (n *Node) Default() *Node {
- if (n.LoadToolkit("gocui") == nil) {
- log(logError, "New() failed to load gocui")
- }
// if DISPLAY isn't set, return since gtk can't load
// TODO: figure out how to check what to do in macos and mswindows
if (os.Getenv("DISPLAY") == "") {
+ if (n.LoadToolkit("gocui") == nil) {
+ log(logError, "New() failed to load gocui")
+ }
return n
}
- if (n.LoadToolkit("andlabs") == nil) {
- log(logError, "New() failed to load andlabs")
+ if (n.LoadToolkit("andlabs") != nil) {
+ return n
}
+ n.LoadToolkit("gocui")
return n
}