summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-20 05:08:52 -0600
committerJeff Carr <[email protected]>2025-01-20 05:08:52 -0600
commit4721184398013ac30160bc5bbde5244256f15d88 (patch)
tree618520cfed22daf36276205835bdc94e92f7ab94
parentef1a3063527e17507af88c644ca1ef7851ab53b0 (diff)
attempt to embedded gocui plugin toolkitv0.22.58
-rw-r--r--Makefile6
-rw-r--r--doGui.go6
-rw-r--r--main.go6
-rw-r--r--resources/forge.text25
4 files changed, 42 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 2fcfecb..e97f825 100644
--- a/Makefile
+++ b/Makefile
@@ -14,10 +14,14 @@ verbose:
GO111MODULE=off go build -v -x \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
-install: goimports vet
+install: goimports vet plugin
GO111MODULE=off go install \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+plugin:
+ rm -f resources/*.so
+ cp ~/go/lib/gocui.so resources/
+
goimports:
reset
goimports -w *.go
diff --git a/doGui.go b/doGui.go
index d80e53c..d7d328c 100644
--- a/doGui.go
+++ b/doGui.go
@@ -26,7 +26,13 @@ func debug() {
}
func doGui() {
+ if me.forge.Config.GetDefaultGui() == "" {
+ me.forge.Config.DefaultGui = "gocui"
+ me.forge.ConfigSave()
+ }
me.myGui = gui.New()
+ me.myGui.InitEmbed(resources)
+ me.myGui.SetAppDefaultPlugin(me.forge.Config.DefaultGui) // sets the default GUI plugin to use
me.myGui.Default()
// debug()
diff --git a/main.go b/main.go
index 49dcb8d..73bab4b 100644
--- a/main.go
+++ b/main.go
@@ -3,6 +3,7 @@ package main
// An app to submit patches for the 30 GO GUI repos
import (
+ "embed"
"os"
"strings"
@@ -17,6 +18,11 @@ import (
var VERSION string
var BUILDTIME string
+// this optionally can store the GUI plugins
+//
+//go:embed resources/*
+var resources embed.FS
+
// used for shell auto completion
var ARGNAME string = "forge"
diff --git a/resources/forge.text b/resources/forge.text
new file mode 100644
index 0000000..3ad9842
--- /dev/null
+++ b/resources/forge.text
@@ -0,0 +1,25 @@
+# this file is automatically re-generated from forge.pb, however,
+# if you want to edit it by hand, you can:
+# stop forge; remove forge.pb; edit forge.text; start forge
+# this will cause the default behavior to fallback to parsing this file for the config
+
+# this file is intended to be used to customize settings on what
+# git repos you have write access to. That is, where you can run 'git push'
+
+ForgeConfigs: {
+ goPath: "go.wit.com"
+ writable: true
+ directory: true
+}
+repos: {
+ goPath: "go.wit.com/apps/zookeeper"
+ debName: "zookeeper-go"
+}
+xterm: "xterm"
+xtermArgv: "-bg"
+xtermArgv: "black"
+xtermArgv: "-fg"
+xtermArgv: "white"
+xtermArgv: "-geometry"
+xtermArgv: "140x32"
+xtermArgv: "-e"