Compare commits

...

4 Commits

Author SHA1 Message Date
Jeff Carr 4f68cad59d don't track go.* files
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-02-19 21:22:09 -06:00
Jeff Carr a8448512d4 go.* files no longer need to be tracked
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-02-18 18:22:56 -06:00
Jeff Carr 9bdc3fcd03 new gui
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-25 01:38:17 -06:00
Jeff Carr d0e1ab2f8e new gui version
Signed-off-by: Jeff Carr <jcarr@wit.com>
2024-01-24 18:24:38 -06:00
18 changed files with 771 additions and 770 deletions

3
.gitignore vendored
View File

@ -1 +1,4 @@
*.swp
go.mod
go.sum
wit-debian-gui wit-debian-gui

View File

@ -8,11 +8,15 @@ VERSION = $(shell cat resources/VERSION)
run: build run: build
./wit-debian-gui ./wit-debian-gui
redomod:
rm -f go.*
go mod init
go mod tidy
new-build: new-build:
# go mod edit -replace go.wit.com/wit/gui=/home/jcarr/go/src/git.wit.org/wit/gui # go mod edit -replace go.wit.com/wit/gui=/home/jcarr/go/src/git.wit.org/wit/gui
# go mod edit -replace go.wit.com/wit/shell=/home/jcarr/go/src/git.wit.org/wit/shell # go mod edit -replace go.wit.com/wit/shell=/home/jcarr/go/src/git.wit.org/wit/shell
# to update go.mod to master: # to update go.mod to master:
# go get go.wit.com/gui/gui@master
go install -ldflags " \ go install -ldflags " \
-X main.GITCOMMIT=${GITCOMMIT} \ -X main.GITCOMMIT=${GITCOMMIT} \
-X main.GOVERSION='${GOVERSION}' \ -X main.GOVERSION='${GOVERSION}' \

7
apt.go
View File

@ -1,9 +1,8 @@
package main package main
import ( import (
"go.wit.com/gui"
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/gui/gui"
) )
func aptGroup(box *gui.Node) { func aptGroup(box *gui.Node) {
@ -17,7 +16,7 @@ func aptGroup(box *gui.Node) {
err := bash("apt install moon-buggy") err := bash("apt install moon-buggy")
return err return err
}) })
if (err != nil) { if err != nil {
log.Warn("Error", "Failed to run:\napt install moon-buggy") log.Warn("Error", "Failed to run:\napt install moon-buggy")
return return
} }
@ -34,7 +33,7 @@ func aptGroup(box *gui.Node) {
sudo(func() error { sudo(func() error {
line := "apt install moon-buggy2" line := "apt install moon-buggy2"
err := bash(line) err := bash(line)
if (err != nil) { if err != nil {
log.Error(err, "Error", "Failed to run:\n"+line) log.Error(err, "Error", "Failed to run:\n"+line)
return err return err
} }

View File

@ -1,9 +1,11 @@
package main package main
import "log" import "log"
// import "os" // import "os"
import "go.wit.com/gui/gui" import "go.wit.com/gui"
// import "github.com/skratchdot/open-golang/open" // import "github.com/skratchdot/open-golang/open"
// import "github.com/davecgh/go-spew/spew" // import "github.com/davecgh/go-spew/spew"

View File

@ -1,3 +1,4 @@
//go:build linux || darwin
// +build linux darwin // +build linux darwin
// File generated by 2goarray v0.1.0 (http://github.com/cratonica/2goarray) // File generated by 2goarray v0.1.0 (http://github.com/cratonica/2goarray)
@ -635,4 +636,3 @@ var myIcon []byte = []byte{
0x25, 0x84, 0xe2, 0xc1, 0xa1, 0x04, 0x20, 0x81, 0x00, 0x00, 0x00, 0x00, 0x25, 0x84, 0xe2, 0xc1, 0xa1, 0x04, 0x20, 0x81, 0x00, 0x00, 0x00, 0x00,
0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
} }

View File

@ -4,10 +4,10 @@ import (
"os" "os"
"time" "time"
"go.wit.com/log"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
"github.com/gobuffalo/packr" "github.com/gobuffalo/packr"
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
"go.wit.com/log"
) )
// origlog "log" // origlog "log"

11
os.go
View File

@ -1,15 +1,14 @@
package main package main
import ( import (
"strings" "bufio"
"errors"
"io/ioutil"
"os" "os"
"os/exec" "os/exec"
"io/ioutil" "strings"
"errors"
"bufio"
"go.wit.com/log" "go.wit.com/log"
// "go.wit.com/gui/gui"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
) )
@ -129,7 +128,7 @@ func sudo(f func() error) error {
uid := os.Getuid() uid := os.Getuid()
e := "You must be root to do this." e := "You must be root to do this."
log.Println(e, "uid =", uid) log.Println(e, "uid =", uid)
if (uid != 0) { if uid != 0 {
log.Warn("Permissions Failed", e) log.Warn("Permissions Failed", e)
return errors.New("not root") return errors.New("not root")
} }

View File

@ -2,17 +2,14 @@ package main
import ( import (
"fmt" "fmt"
"os"
"io/ioutil" "io/ioutil"
"log" "log"
"os"
"time" "time"
// "go.wit.com/gui/gui"
"go.wit.com/gui/debugger"
"github.com/davecgh/go-spew/spew" "github.com/davecgh/go-spew/spew"
"github.com/getlantern/systray" "github.com/getlantern/systray"
"go.wit.com/lib/debugger"
// "github.com/skratchdot/open-golang/open"
) )
func systrayMain() { func systrayMain() {

View File

@ -1,3 +1,4 @@
//go:build darwin || freebsd || dragonfly || openbsd || netbsd
// +build darwin freebsd dragonfly openbsd netbsd // +build darwin freebsd dragonfly openbsd netbsd
// https://github.com/creack/termios/blob/master/raw/tioc_bsd.go // https://github.com/creack/termios/blob/master/raw/tioc_bsd.go

View File

@ -9,8 +9,6 @@ import (
"log" "log"
"runtime/debug" "runtime/debug"
"time" "time"
// "go.wit.com/gui/gui"
) )
type myChan struct { type myChan struct {

View File

@ -1,15 +1,13 @@
package main package main
import ( import (
// "bufio"
"os" "os"
"runtime" "runtime"
"runtime/debug" "runtime/debug"
"runtime/pprof" "runtime/pprof"
"go.wit.com/log" "go.wit.com/log"
// "go.wit.com/gui/gui" "go.wit.com/lib/gadgets"
"go.wit.com/gui/gadgets"
) )
var langWin *gadgets.BasicWindow var langWin *gadgets.BasicWindow

View File

@ -1,14 +1,14 @@
package main package main
import ( import (
"go.wit.com/gui/gui" "go.wit.com/gui"
"go.wit.com/gui/gadgets" "go.wit.com/lib/gadgets"
) )
var upDNSwin *gadgets.BasicWindow var upDNSwin *gadgets.BasicWindow
func updateDNS(w *gui.Node) { func updateDNS(w *gui.Node) {
if (upDNSwin != nil) { if upDNSwin != nil {
upDNSwin.Toggle() upDNSwin.Toggle()
return return
} }

View File

@ -7,8 +7,8 @@ import (
"os" "os"
"strings" "strings"
"go.wit.com/gui/gui" "go.wit.com/gui"
"go.wit.com/gui/gadgets" "go.wit.com/lib/gadgets"
) )
var aptWin *gadgets.BasicWindow var aptWin *gadgets.BasicWindow

View File

@ -1,8 +1,8 @@
package main package main
import ( import (
"go.wit.com/lib/gadgets"
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/gui/gadgets"
) )
var tabWin *gadgets.BasicWindow var tabWin *gadgets.BasicWindow

View File

@ -1,14 +1,14 @@
package main package main
import ( import (
"os"
"bufio" "bufio"
"strings"
"errors" "errors"
"os"
"strings"
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
) )
var filename string = "resolv-1-1-1-1.conf" var filename string = "resolv-1-1-1-1.conf"
@ -17,7 +17,7 @@ var generaloutput *gui.Node
var resWin *gadgets.BasicWindow var resWin *gadgets.BasicWindow
func resolvWindow() { func resolvWindow() {
if (resWin != nil) { if resWin != nil {
resWin.Toggle() resWin.Toggle()
return return
} }
@ -45,7 +45,7 @@ func resolvWindow() {
log.Println("STARTED HOSTNAME") log.Println("STARTED HOSTNAME")
filename = resolvNode.GetText() filename = resolvNode.GetText()
b, _ := packrBox.FindString(filename) b, _ := packrBox.FindString(filename)
if (generaloutput != nil) { if generaloutput != nil {
generaloutput.SetText(b) generaloutput.SetText(b)
} }
log.Println("ENDED GetText() HOSTNAME =", filename) log.Println("ENDED GetText() HOSTNAME =", filename)
@ -83,7 +83,7 @@ func resolvWindow() {
}) })
gNode.NewButton("set output", func() { gNode.NewButton("set output", func() {
if (generaloutput != nil) { if generaloutput != nil {
generaloutput.SetText("wow") generaloutput.SetText("wow")
generaloutput.Margin() generaloutput.Margin()
} }

View File

@ -3,16 +3,16 @@ package main
import ( import (
"os/user" "os/user"
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
) )
var userNode *gui.Node var userNode *gui.Node
var sshWin *gadgets.BasicWindow var sshWin *gadgets.BasicWindow
func sshGenericWindow() { func sshGenericWindow() {
if (sshWin != nil) { if sshWin != nil {
sshWin.Toggle() sshWin.Toggle()
return return
} }

View File

@ -1,15 +1,15 @@
package main package main
import ( import (
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
) )
var webWin *gadgets.BasicWindow var webWin *gadgets.BasicWindow
func windowAddWWW() { func windowAddWWW() {
if (webWin != nil) { if webWin != nil {
webWin.Toggle() webWin.Toggle()
return return
} }

View File

@ -3,9 +3,9 @@ package main
import ( import (
"io/ioutil" "io/ioutil"
"go.wit.com/gui"
"go.wit.com/lib/gadgets"
"go.wit.com/log" "go.wit.com/log"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
) )
var fontNode *gui.Node var fontNode *gui.Node
@ -14,7 +14,7 @@ var fontsize string = ""
var xtermWin *gadgets.BasicWindow var xtermWin *gadgets.BasicWindow
func xtermSettings(w *gui.Node) { func xtermSettings(w *gui.Node) {
if (xtermWin != nil) { if xtermWin != nil {
xtermWin.Toggle() xtermWin.Toggle()
return return
} }
@ -58,7 +58,7 @@ func xtermSettings(w *gui.Node) {
}) })
gNode.NewButton("fontNode.GetText()", func() { gNode.NewButton("fontNode.GetText()", func() {
if (fontNode != nil) { if fontNode != nil {
fontsize = fontNode.GetText() fontsize = fontNode.GetText()
log.Println("set fontsize =", fontsize) log.Println("set fontsize =", fontsize)
} }