From c780a62521d410f180fdd7a8bef26fa14851710f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 28 Apr 2023 08:14:10 -0500 Subject: [PATCH] debug embed handling Signed-off-by: Jeff Carr --- .gitignore | 1 + Makefile | 5 ++--- main.go | 11 ++++++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 7941352..1a68be7 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ wit-new-machine /files/* /*.deb /resources/toolkits/ +/plugins/ diff --git a/Makefile b/Makefile index 41159e5..7094679 100644 --- a/Makefile +++ b/Makefile @@ -7,10 +7,9 @@ VERSION = $(shell cat resources/VERSION) build: git pull - # reset - -cp ~/go/src/git.wit.org/wit/gui/toolkit/*.so resources/toolkits/ + -cp ~/go/src/git.wit.org/wit/gui/toolkit/*.so plugins/ GO111MODULE="off" go build -v - ./wit-new-machine --gui-toolkit gocui >/tmp/witgui.log.stderr 2>&1 + ./wit-new-machine --gui-toolkit gocui >/tmp/witgui.log.stderr 2>&1 nocui: ./wit-new-machine --gui-toolkit nocui diff --git a/main.go b/main.go index fd0f032..dc76032 100644 --- a/main.go +++ b/main.go @@ -20,10 +20,11 @@ var username string var hostname string var geom string = "120x30+500+500" + //go:embed resources var res embed.FS -//go:embed resources/toolkits +//go:embed plugins/*.so var resToolkit embed.FS //go:embed resources/ttyS0.conf @@ -54,9 +55,13 @@ func main() { } if (args.GuiToolkit == nil) { - myGui = gui.New().InitEmbed(resToolkit).Default() + myGui = gui.New().Default() } else { - myGui = gui.New().InitEmbed(resToolkit).LoadToolkit(args.GuiToolkit[0]) + if args.GuiToolkit[0] == "gocui" { + myGui = gui.New().LoadToolkit(args.GuiToolkit[0]) + } else { + myGui = gui.New().InitEmbed(resToolkit).LoadToolkit(args.GuiToolkit[0]) + } } drawWindow()