Compare commits

..

No commits in common. "master" and "v0.0.1" have entirely different histories.

18 changed files with 770 additions and 771 deletions

3
.gitignore vendored
View File

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

View File

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

7
apt.go
View File

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

View File

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

View File

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

View File

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

11
os.go
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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